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. ...

Get Android Programming for Beginners now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.