Lifecycle is a class that holds the information about the lifecycle state of a component (like an activity or fragment) and allows other objects to observe this state.
It has 2 main enums to track the lifecycle status:
- Events - They are the lifecycle events dispatched from the Android Framework like onCreate, onPause, etc.
- States - The current state of the component and how they are marked as our Activity or Fragment moves between events.
In this lesson, we will go behind the scenes and understand
- What Events and States ar
- How to observe events
- Order of how lifecycle events are observed