From 5c04dab7b2576357f0641897f1bb76544ff87d43 Mon Sep 17 00:00:00 2001 From: "fps.io" Date: Mon, 15 Aug 2022 17:27:51 +0200 Subject: [PATCH] Remove activity from recents list on exit (fixes #1805) (#1824) --- .../nutomic/syncthingandroid/fragments/DrawerFragment.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/nutomic/syncthingandroid/fragments/DrawerFragment.java b/app/src/main/java/com/nutomic/syncthingandroid/fragments/DrawerFragment.java index 6c0703b7..c0c82260 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/fragments/DrawerFragment.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/fragments/DrawerFragment.java @@ -287,6 +287,10 @@ public class DrawerFragment extends Fragment implements View.OnClickListener { } Log.i(TAG, "Exiting app on user request"); mActivity.stopService(new Intent(mActivity, SyncthingService.class)); - mActivity.finish(); + if(android.os.Build.VERSION.SDK_INT >= 21) { + mActivity.finishAndRemoveTask(); + } else { + mActivity.finish(); + } } }