- // Listen for clicks on entries in `listView`.
- listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
- @Override
- public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
- // Convert the `long` `id` to an `int`.
- int itemId = (int) id;
-
- // Only consume the click if it is not on the `currentPageId`.
- if (itemId != currentPageId) {
- // Go forward or back to `itemId`.
- urlHistoryListener.onUrlHistoryEntrySelected(currentPageId - itemId);
-
- // Dismiss the `Dialog`.
- alertDialog.dismiss();
- }
+ // Listen for clicks on entries in the list view.
+ listView.setOnItemClickListener((AdapterView<?> parent, View view, int position, long id) -> {
+ // Convert the long ID to an int.
+ int itemId = (int) id;
+
+ // Only consume the click if it is not on the `currentPageId`.
+ if (itemId != currentPageId) {
+ // Go forward or back to `itemId`.
+ urlHistoryListener.onUrlHistoryEntrySelected(currentPageId - itemId);
+
+ // Dismiss the `Dialog`.
+ alertDialog.dismiss();