Which of the following Activity life-cycle methods is invoked when a dialog is shown?
Which of the following Activity life-cycle methods is invoked when a dialog is shown?
When a dialog is shown, the current Activity goes into the background but is still visible, and the onPause() method is invoked. onPause() is called when the system is about to put the activity into the background or when a dialog appears. This is the appropriate method to deal with these situations.
A. onPause()