The Android Lifecycle
Understand activity and composition lifecycles.
What Is the Lifecycle?
Every Android Activity moves through a series of states as the user opens, leaves, and returns to your app. This is the lifecycle.
Understanding it lets you start and stop work at the right times.
Core Activity Callbacks
The classic Activity lifecycle callbacks run in order:
onCreate— the Activity is being created.onStart— becoming visible.onResume— in the foreground, interactive.onPause/onStop/onDestroy— leaving.
All lessons in this course
- Why Use a ViewModel?
- Exposing State from ViewModel
- The Android Lifecycle
- collectAsStateWithLifecycle