]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/dialogs/UrlHistoryDialog.java
Updates about_licenses, adding the full text of the Apache License 2.0 and the 3...
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / dialogs / UrlHistoryDialog.java
index 4811ea2dae1853bee544ae24b55b56dc8b30b896..3c418d393887053fe77caead7878fb73f9ebf140 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2017 Soren Stoutner <soren@stoutner.com>.
+ * Copyright © 2016-2017 Soren Stoutner <soren@stoutner.com>.
  *
  * This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
  *
@@ -220,9 +220,6 @@ public class UrlHistoryDialog extends AppCompatDialogFragment{
         // Get a handle for `listView`.
         ListView listView = (ListView) alertDialog.findViewById(R.id.history_listview);
 
-        // Remove the warning below that `listView` might be `null`.
-        assert listView != null;
-
         // Set the adapter on `listView`.
         listView.setAdapter(historyArrayAdapter);
 
@@ -233,15 +230,9 @@ public class UrlHistoryDialog extends AppCompatDialogFragment{
                 // Convert the `long` `id` to an `int`.
                 int itemId = (int) id;
 
-                // Only enable the click if it is not on the `currentPageId`.
+                // Only consume the click if it is not on the `currentPageId`.
                 if (itemId != currentPageId) {
-                    // Get the history entry for this `itemId`.
-                    History historyEntry = historyArrayAdapter.getItem(itemId);
-
-                    // Remove the lint warning below that `historyEntry` might be `null`.
-                    assert historyEntry != null;
-
-                    // Send the history entry URL to be loaded in `mainWebView`.
+                    // Go forward or back to `itemId`.
                     urlHistoryListener.onUrlHistoryEntrySelected(currentPageId - itemId);
 
                     // Dismiss the `Dialog`.