17 Questions
Which method is called before the activity is destroyed in the Activity lifecycle?
onDestroy()
In the lifecycle of an Activity, which method indicates that the activity is no longer visible to the user?
onStop()
When can the Android runtime system kill an Activity without calling onStop() and onDestroy() methods?
During onPause()
Which method allows an Activity to perform setup before becoming visible to the user?
onCreate()
In the Activity lifecycle, which method follows onResume() but precedes onDestroy()?
onPause()
When is the onCreate method called in the Activity lifecycle?
Before the Activity is visible to the user
In which state does an Activity have the focus of the user in the foreground?
Resumed state
What happens to an Activity when it goes into the Paused state?
The Activity remains alive and partially visible
Which method is called when another Activity comes to the foreground and the current Activity goes into the Paused state?
onPause method
What happens to an Activity in the Stopped state?
The Activity is no longer visible to the user
Which method is called when an Activity stops and relinquishes its involvement with the window manager?
onStop method
What methods are executed when starting an Android application?
onCreate(), onResume(), onStart()
How does an Activity retain its previous state after calling onPause() or onStop() methods?
Activity object is pushed into a stack during onStop() and pops up during onResume()
What method is called before onDestroy() to preserve the state of an Activity?
onSaveInstanceState()
Which callback method is executed when an Activity is just about to be destroyed?
onDestroy()
What happens to the state of an Activity when it is destroyed using onDestroy() method?
State is preserved in a Bundle object using onSaveInstanceState()
At what point does an Activity's state get saved in the Bundle class?
onSaveInstanceState() method before onDestroy()
Learn about the lifecycle of an Activity in Android, from its creation to its conclusion, and the specific methods associated with each stage. Understand the journey of an Activity as it passes through stages like create, start, pause, stop, and more.
Make Your Own Quizzes and Flashcards
Convert your notes into interactive study material.
Get started for free