Android Application Development (AND-401) — Question 68
Which of the following methods is called first in an Activity when another activity gets into the foreground?
Answer options
- A. onStop()
- B. onPause()
- C. onDestroy()
- D. onExit()
Correct answer: B
Explanation
The correct answer is B, onPause(), as this method is called when the current Activity is partially obscured by another Activity. The other options are incorrect because onStop() is called after onPause(), onDestroy() is called when the Activity is being destroyed, and onExit() is not a valid lifecycle method in Android.