Lifecycle phases – what we need to do
When we are programming an app, how do we possibly interact with this complexity? The good news is that the Android code that was auto-generated when we created our first project does most of it for us. As we have discussed, we just don't see the methods that handle this, but we do have the opportunity to override them and add our own code to that phase.
This means we can get on with learning Java and making Android apps until we come to one of the few instances for which we need to do something, specifically in one of the phases.
Tip
Each Activity has its own lifecycle
Actually, this discussion is relevant to just an Activity. So, if our app has more than one Activity, they will each have their own lifecycle. This doesn't have to complicate things, and in the long run it will make things easier for us.
Here is a quick explanation of the methods provided by Android, for our convenience, to manage the lifecycle phases. To clarify our discussion of lifecycle...