Material Dialog suddenly closes when going to another activity in Android Kotlin
I have a material dialog inside onForegroundStart() in my BaseActivity. I have extended all my Activities in BaseActivity and opening an app will go to SplashActivity -> HomeActivity if the user is logged in. However, I have noticed that the dialog will suddenly closes when going to another activity. Is there anything that I have missed?
@OnLifecycleEvent(Lifecycle.Event.ON_CREATE)
fun onCreate() {
if (isLoggedIn()) {
dialog = MaterialDialog(this)
.show...