Activity Lifecycle
ANDROID › Lifecycle
Drills the ordered create/start/resume/pause/stop/destroy callbacks, state saving, and multi-window and launch-mode lifecycle effects.
Lifecycle is the single most-asked Android fundamentals topic; interviewers probe the exact callback ordering and the subtle cases that reveal whether you truly understand activity state. Expect to reconstruct callback sequences for rotation, Back vs Home, process death, and multi-window, and to justify what work belongs in each callback. Mistakes here, such as doing heavy saves in onPause or assuming onSaveInstanceState runs on Back, are common red flags.
What this covers
- The exact order and meaning of onCreate, onStart, onResume, onPause, onStop, onDestroy (plus onRestart)
- Callback sequences for cold start, Back, Home, rotation, process death, and starting another activity
- onSaveInstanceState and onRestoreInstanceState: when they fire, when they do not (Back/finish), and the savedInstanceState Bundle
- Foreground-entry vs background: which callbacks run, and what work belongs in each
- Multi-window and multi-resume: visible-while-Paused, and onTopResumedActivityChanged for exclusive resources
- The finish()-in-onCreate exception, and how launch modes and onNewIntent alter the lifecycle
Study this topic
- Activity Lifecycle explained: the guided lesson
- 13 practice quiz questions
- 9 revision flashcards
- Activity Lifecycle interview questions and answers