]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/commitdiff
Remove Privacy Browser from the recent app list when closed with back. https://redmi...
authorSoren Stoutner <soren@stoutner.com>
Mon, 19 Aug 2019 22:41:36 +0000 (15:41 -0700)
committerSoren Stoutner <soren@stoutner.com>
Mon, 19 Aug 2019 22:41:36 +0000 (15:41 -0700)
app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java

index a452c0b170b669765620655b41cfe782e0acb8e5..e8b6c0a6db5fab0e64299820eb9031af8cc7a40b 100644 (file)
@@ -2864,8 +2864,12 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
             // Close the current tab.
             closeCurrentTab();
         } else {  // There isn't anything to do in Privacy Browser.
             // Close the current tab.
             closeCurrentTab();
         } else {  // There isn't anything to do in Privacy Browser.
-            // Run the default commands.
-            super.onBackPressed();
+            // Close Privacy Browser.  `finishAndRemoveTask()` also removes Privacy Browser from the recent app list.
+            if (Build.VERSION.SDK_INT >= 21) {
+                finishAndRemoveTask();
+            } else {
+                finish();
+            }
 
             // Manually kill Privacy Browser.  Otherwise, it is glitchy when restarted.
             System.exit(0);
 
             // Manually kill Privacy Browser.  Otherwise, it is glitchy when restarted.
             System.exit(0);