So my Application has an Activity A and few other Activities B,C,D etc, all of which opens on different clicks from Activity A. My requirement is to show a "Enter Pin" DialogBox every time app is opened from outside like (starting app first time, unlocking screen, resuming app after it was paused and other apps were used).
But Dialogbox should not show up when i open and close other Activities (B,C,D etc).
But in both cases, onPause->onStop->onRestart->onResume is called. So how should i distinguish that whether the user has gone outside the app or not and where should i place my dialog.show()