Chapter 6. The Android Lifecycle
In this chapter, we will familiarize ourselves with the lifecycle of an Android app. The idea that a computer program has a lifecycle might sound strange at first, but it will soon make sense.
The lifecycle is the way that all Android apps interact with the Android OS. In the same way that the lifecycle of humans enables them to interact with the world around them, we have no choice but to interact with the Android lifecycle and we must be prepared to handle numerous unpredictable events if we want our apps to survive.
We will explore the phases of the lifecycle that an app goes through, from creation to destruction, and how this helps us know where to put our Kotlin code, depending on what we are trying to achieve.
In this chapter, we will explore the following topics:
- The life and times of an Android app
- The process of overriding and the
override
keyword - The phases of the Android lifecycle
- What exactly we need to know and do to code our apps
- A lifecycle...