App has PIN lock activity thats is opened over current activity. Purpose of this activity is to prevent unauthenticated users from using the app. I keep this activity separately from main activity stack. My problem is, when user closes app while PINUnlockActivity is still visible, then relaunches app by clicking launcher icon, or by selecting it from recent apps PINUnlockActivity gets destroyed. Below is my code, that starts PINUnlockActivity. What is the correct way to handle two parallel activity stacks in my scenario?
How system decides which activity stack to show on app resume?
val intent = Intent(App.instance, PinActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS or Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
AppContext.startActivity(intent)