Android Application Components and Activity Lifecycle
Test your knowledge of Android application architecture, components (Activities, Services, Broadcast Receivers, Content Providers), and the activity lifecycle methods (onCreate, onStart, onResume, onPause, onStop, onDestroy).
Questions
Activities are basic objects, describing things a user can see or do and they can subscribe for intents.
- True
- False
In a typical activity lifecycle, if an activity "AA1" is completely obscured by another activity "AA2", the current state of "AA1" activity is -
- Paused State
- Active State
- Stopped State
- Hidden State
- None of above
If an activity is paused or stopped, the system can drop it from memory by calling -
- Calling drop() method
- Calling finish() method
- Calling release() method
- kill the process_id
- Above b or d
- None of above
The visible lifetime of an activity happens between a call to onStart() until a corresponding call to onPause(). Choose the right answer.
- True
- False
The foreground lifetime of an activity happens between a call to onResume() until a corresponding call to onStop().
- True
- False
____ method is called just before the activity starts interacting with the user. At this point the activity is at the top of the activity stack, with user input going to it.
- onPause()
- onResume()
- onRestart()
- onStart()
- None of above
The activity in this state is killable by the system.
- onDestroy()
- onStop()
- onPause()
- Above a & c
- Above a & b
- Above a & b & c
The following method is called when the system is about to start resuming another activity
- onStop()
- onPause()
- onRestart()
- onDestroy()
- None of above
The onStart() and onStop() methods can be called multiple times, as the activity alternates between being visible and hidden to the user.
- True
- False
__________ method is called when activity is first created
- onStart()
- onResume()
- onCreate()
- None of above
Between ______ & ________methods, you can maintain resources that are needed to show the activity to the user.
- onResume(), onStop()
- onStart(), onStop()
- onStart(), onDestroy()
- onResume(), onDestroy()
- None of above
________ method is passed a Bundle object containing the activity's previous state, if that state was captured.
- onCreate()
- onResume()
- onStart()
- None of above
Suppose there are two applications having same priority, but the process that has _______ priority will be killed first.
- Highest
- Lowest
- Medium
- None of above
An Android Application can be “Alive” even when process has been killed
- True
- False
All Android applications will remain running and in memory until the system needs its resources for other applications.
- True
- False
A typical Android application has ________ components.
- 3
- 5
- 4
- 6
- None of above
An android application includes the following components -
- Activity, Service, Process and Content Provider
- Activity, Intent, Process and Service
- Activity, Service, Broadcast Receiver and Content provider
- Service, Process, Broadcast Receiver and Content Provider
- None of above
Android Application typically consist of several screens where each screen is implemented by more than one activity. Choose the right answer.
- True
- False
A fundamental feature of Android is that an application process's lifetime is directly controlled by the application itself.
- True
- False
An activity has essentially ___ states.
- 3
- 4
- 2
- 5
- None of above