Relaunch and recreate is slightly different

This commit is contained in:
topjohnwu 2021-11-05 16:05:12 -07:00
parent 1bdd6e1a9d
commit 2115bcd8b0
2 changed files with 6 additions and 1 deletions

View File

@ -59,7 +59,7 @@ abstract class BaseMainActivity<VM : BaseViewModel, Binding : ViewDataBinding>
doPreload = false
if (isRunningAsStub) {
// Re-launch main activity without splash theme
recreate()
relaunch()
} else {
showMainUI(savedInstanceState)
}

View File

@ -69,4 +69,9 @@ abstract class BaseActivity : AppCompatActivity() {
startActivity(Intent().setComponent(intent.component))
finish()
}
fun relaunch() {
startActivity(Intent(intent).setFlags(0))
finish()
}
}