From: Soren Stoutner Date: Mon, 19 Aug 2019 22:41:36 +0000 (-0700) Subject: Remove Privacy Browser from the recent app list when closed with back. https://redmi... X-Git-Tag: v3.3~15 X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=833e68e01a23035ccbab1e69b123d530061be4ce;p=PrivacyBrowserAndroid.git Remove Privacy Browser from the recent app list when closed with back. https://redmine.stoutner.com/issues/483 --- 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 a452c0b1..e8b6c0a6 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java @@ -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);