Question & Answer

Which of the following methods is first called in an Activity when another activity gets into the foreground?

Which of the following methods is first called in an Activity when another activity gets into the foreground? A. onStop

B. onPause

C. onDestroy

D. onExit

1 Answer

Verified archive
Quizzma TeamJuly 7, 2025

The correct answer is B. onPause.

When another activity comes into the foreground, the current activity goes through several lifecycle methods. The first one called is `onPause()`, which indicates that the activity is partially obscured and no longer in the foreground. After `onPause()`, the `onStop()` method is called if the activity is completely hidden.

If you have more questions about Android activity lifecycle or other topics, feel free to ask or check the extended services page for further assistance!