Recall & Review
beginner
What is an Activity in Android?
An Activity is a single screen in an Android app where the user interacts. It controls the UI and handles user actions.
Click to reveal answer
beginner
Which method is called when an Activity is first created?
The onCreate() method is called when the Activity is first created. It is where you set up the UI and initialize components.
Click to reveal answer
intermediate
Name two lifecycle methods called when an Activity becomes visible and when it goes to the background.
onStart() is called when the Activity becomes visible. onStop() is called when the Activity is no longer visible (goes to background).
Click to reveal answer
beginner
How do you start a new Activity from the current Activity?
You create an Intent specifying the new Activity class and call startActivity(intent) to open it.Click to reveal answer
intermediate
What is the purpose of the onPause() method in an Activity?
onPause() is called when the Activity is partially obscured or about to go into the background. Use it to pause animations or save data.
Click to reveal answer
Which method is NOT part of the Activity lifecycle?
✗ Incorrect
onClick() is an event handler for clicks, not a lifecycle method.
What does the onResume() method indicate?
✗ Incorrect
onResume() means the Activity is visible and ready for user interaction.
How do you open a new Activity named DetailActivity?
✗ Incorrect
You create an Intent with the current context and target Activity class, then call startActivity.
Which lifecycle method should you use to save user data before the Activity is stopped?
✗ Incorrect
onPause() is the right place to save data before the Activity goes to background.
What happens when you call finish() inside an Activity?
✗ Incorrect
finish() closes the current Activity and removes it from the back stack.
Explain the Android Activity lifecycle and why it is important.
Think about what happens when the user opens, uses, and leaves an Activity.
You got /8 concepts.
Describe how to navigate from one Activity to another in Android.
Consider how you tell Android to show a new screen.
You got /4 concepts.