From 2115bcd8b079e6e3467ff0dfaecb67055c970402 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Fri, 5 Nov 2021 16:05:12 -0700 Subject: [PATCH] Relaunch and recreate is slightly different --- .../main/java/com/topjohnwu/magisk/arch/BaseMainActivity.kt | 2 +- .../main/java/com/topjohnwu/magisk/core/base/BaseActivity.kt | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/arch/BaseMainActivity.kt b/app/src/main/java/com/topjohnwu/magisk/arch/BaseMainActivity.kt index c3f4981c7..16ddf444a 100644 --- a/app/src/main/java/com/topjohnwu/magisk/arch/BaseMainActivity.kt +++ b/app/src/main/java/com/topjohnwu/magisk/arch/BaseMainActivity.kt @@ -59,7 +59,7 @@ abstract class BaseMainActivity doPreload = false if (isRunningAsStub) { // Re-launch main activity without splash theme - recreate() + relaunch() } else { showMainUI(savedInstanceState) } diff --git a/app/src/main/java/com/topjohnwu/magisk/core/base/BaseActivity.kt b/app/src/main/java/com/topjohnwu/magisk/core/base/BaseActivity.kt index c39cc1344..a206b1592 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/base/BaseActivity.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/base/BaseActivity.kt @@ -69,4 +69,9 @@ abstract class BaseActivity : AppCompatActivity() { startActivity(Intent().setComponent(intent.component)) finish() } + + fun relaunch() { + startActivity(Intent(intent).setFlags(0)) + finish() + } }