I am using a third-party library and sometimes it pops up a dialog. Before I finish the current activity, I want to check whether there is a dialog popped up in the current con
You can override activity method onWindowFocusChanged(boolean hasFocus)
and track the state of your activity.
Normally, if some alert dialog is shown above your activity, the activity does not get onPause()
and onResume()
events. But it loses focus on alert dialog shown and gains it when it dismisses.