X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Factivities%2FMainWebViewActivity.java;h=e5d1f8c89507994351bc769043accd1f2f53190a;hp=5b39fdcba08cabd6fd0f3e9d2c1d4d07761fb4cc;hb=91154b307513e7bc6958b27fba518e4f9b564cf9;hpb=4ce562261f47e06c454504262a24f61f46bb393d diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java index 5b39fdcb..e5d1f8c8 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java @@ -1,5 +1,5 @@ /* - * Copyright © 2015-2020 Soren Stoutner . + * Copyright © 2015-2021 Soren Stoutner . * * Download cookie code contributed 2017 Hendrik Knackstedt. Copyright assigned to Soren Stoutner . * @@ -649,11 +649,11 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook updatePrivacyIcons(true); } - // `onResume()` runs after `onStart()`, which runs after `onCreate()` and `onRestart()`. + // `onStart()` runs after `onCreate()` or `onRestart()`. This is used instead of `onResume()` so the commands aren't called every time the screen is partially hidden. @Override - public void onResume() { + public void onStart() { // Run the default commands. - super.onResume(); + super.onStart(); // Resume any WebViews. for (int i = 0; i < webViewPagerAdapter.getCount(); i++) { @@ -702,10 +702,11 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook } } + // `onStop()` runs after `onPause()`. It is used instead of `onPause()` so the commands are not called every time the screen is partially hidden. @Override - public void onPause() { + public void onStop() { // Run the default commands. - super.onPause(); + super.onStop(); for (int i = 0; i < webViewPagerAdapter.getCount(); i++) { // Get the WebView tab fragment. @@ -2594,7 +2595,7 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook } @Override - public void onSaveBookmarkFolder(DialogFragment dialogFragment, int selectedFolderDatabaseId, Bitmap favoriteIconBitmap) { + public void onSaveBookmarkFolder(DialogFragment dialogFragment, int selectedFolderDatabaseId, @NonNull Bitmap favoriteIconBitmap) { // Remove the incorrect lint warning below that the dialog fragment might be null. assert dialogFragment != null;