]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/activities/MainWebView.java
Navigate up folders in the Bookmarks activity when the back button is pressed. Fixes...
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / activities / MainWebView.java
index 5ac470bbf6727152f00007394ecb52b60344ad23..952f5aae93d0066eb226134ecaa4978fa171bf3a 100644 (file)
@@ -1417,11 +1417,9 @@ public class MainWebView extends AppCompatActivity implements NavigationView.OnN
         mainWebView.clearHistory();
     }
 
-    // Override onBackPressed to handle the navigation drawer and mainWebView.
+    // Override `onBackPressed` to handle the navigation drawer and `mainWebView`.
     @Override
     public void onBackPressed() {
-        final WebView mainWebView = (WebView) findViewById(R.id.mainWebView);
-
         // Close the navigation drawer if it is available.  GravityCompat.START is the drawer on the left on Left-to-Right layout text.
         if (drawerLayout.isDrawerVisible(GravityCompat.START)) {
             drawerLayout.closeDrawer(GravityCompat.START);
@@ -1430,7 +1428,7 @@ public class MainWebView extends AppCompatActivity implements NavigationView.OnN
             if (mainWebView.canGoBack()) {
                 mainWebView.goBack();
             } else {
-                // Pass onBackPressed to the system.
+                // Pass `onBackPressed()` to the system.
                 super.onBackPressed();
             }
         }