Skip to main content
InterviewHubPRO
Section Overview
Q1

Question 1 of 50

Part 1: Architecture, Jetpack Compose & Core Components (1 - 10)

2%
Android & Jetpack Compose (50 Qs)•Part 1: Architecture, Jetpack Compose & Core Components (1 - 10)

What is the Activity Lifecycle in Android and what are its core callback states?

senior LevelCode ExampleComponentsLifecycleDocker & Containers

In Simple Words: An Activity represents a single focused screen that the user can interact with. Its lifecycle transitions through 6 core callbacks:

  1. onCreate(): Activity is initialized; setup UI views, data bindings, and ViewModel observers.
  2. onStart(): Activity becomes visible to the user, but not yet interactive.
  3. onResume(): Activity enters the foreground; interactive and receiving user input.
  4. onPause(): Activity partially obscured (e.g. permission dialog, multi-window mode) or about to enter background; pause animations or video playback.
  5. onStop(): Activity is no longer visible to the user.
  6. onDestroy(): Final cleanup before the activity is destroyed by the system or finish() is called.
text
Activity Lifecycle State Flow:
[onCreate] ──► [onStart] ──► [onResume] (Interactive in Foreground)
                                 │
                            [onPause] (Partially Obscured)
                                 │
                            [onStop]  (Hidden in Background)
                                 │
                           [onDestroy] (Deallocated from RAM)