]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/MainWebViewActivity.java
Update the Permission and the Privacy Policy tabs. Add a Clear History button.
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / MainWebViewActivity.java
index 779d2d69b91a0e1c6d299c4dab2315439a063a75..077aa49b06e665b4c3cb7cafa72481f7ca3ebe44 100644 (file)
@@ -1288,6 +1288,12 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation
         mainWebView.goBackOrForward(moveBackOrForwardSteps);
     }
 
+    @Override
+    public void onClearHistory() {
+        // Clear the history.
+        mainWebView.clearHistory();
+    }
+
     // Override onBackPressed to handle the navigation drawer and mainWebView.
     @Override
     public void onBackPressed() {
@@ -1309,6 +1315,10 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation
 
     @Override
     public void onPause() {
+        // Pause `mainWebView`.
+        mainWebView.onPause();
+        mainWebView.pauseTimers();
+
         // We need to pause the adView or it will continue to consume resources in the background on the free flavor.
         BannerAd.pauseAd(adView);
 
@@ -1319,6 +1329,10 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation
     public void onResume() {
         super.onResume();
 
+        // Resume `mainWebView`.
+        mainWebView.resumeTimers();
+        mainWebView.onResume();
+
         // We need to resume the adView for the free flavor.
         BannerAd.resumeAd(adView);
     }