Podcast
Questions and Answers
When is the onPause() method called?
When is the onPause() method called?
- When a new page appears
- When the activity starts interacting with the user
- When the activity becomes visible to the user
- When the activity is killed because of pressing the back button (correct)
What is the purpose of the onRestart() method?
What is the purpose of the onRestart() method?
- To free up resources before the activity is destroyed
- To restart the activity that has been stopped (correct)
- To start any background services
- To initiate the 'visible' lifespan of the application
Which method is called when the activity is no longer visible to the user?
Which method is called when the activity is no longer visible to the user?
- onResume()
- onStart()
- onStop() (correct)
- onDestroy()
What does onDestroy() method help in doing before an activity is destroyed?
What does onDestroy() method help in doing before an activity is destroyed?
Why is onRestart() called before onStart() when transitioning from onStop to onStart?
Why is onRestart() called before onStart() when transitioning from onStop to onStart?
Which method is responsible for stopping any services/threads that are running when the activity is not in the foreground?
Which method is responsible for stopping any services/threads that are running when the activity is not in the foreground?
What is the main purpose of an activity in Android applications?
What is the main purpose of an activity in Android applications?
Which method is called when an activity is first created?
Which method is called when an activity is first created?
What is the function of setContentView(R.layout.home_layout);
in Android activities?
What is the function of setContentView(R.layout.home_layout);
in Android activities?
In AndroidManifest.xml, why must every activity in the application be declared?
In AndroidManifest.xml, why must every activity in the application be declared?
Which method is invoked when the user presses the Back button to destroy the current activity?
Which method is invoked when the user presses the Back button to destroy the current activity?
What does the onResume()
method signify in the activity life cycle?
What does the onResume()
method signify in the activity life cycle?
Flashcards are hidden until you start studying