Activity life cycle: When a dialog is displayed on top of your activity, is your activity in foreground state or visible state?
it calls onPause()
it calls onPause() -> then -> onStop() -> onDestroy()
it calls onPause() -> then -> onStop()
it calls onResume()
When a dialog comes on top of an existing activity, then existing activity will move to partially invisible state by calling onPause().
onPause() is called when your activity is no longer at the top of the activity stack. A Dialog by itself is not an Activity, so will not replace the current Activity at the top of the stack, so will not cause anything to pause.
A dialog (lower-case) does not need to be implemented by a Dialog class, however. For example it is not uncommon to implement one with an Activity whose theme is set to that of a dialog. In this case displaying the dialog-as-an-Activity will cause the new Activity to be on the top of the stack, pausing what previously was there.
Back To Top