Remove Privacy Browser from the recent app list when closed with back. https://redmi... master
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 a452c0b..e8b6c0a 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.
-            // 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);