Lifecycle phases – what we need to know
The Android system has multiple different phases that any given app can be in. Depending upon the phase, the Android system determines how the app is viewed by the user or whether it is viewed at all. Android has these phases, so it can decide which app is in current use and then allocate the right amount of resources, such as memory and processing power. But it also allows us as app developers to interact with these phases.
We have already raised the issue of what will happen if the user quits our app to answer a phone call, will they lose their progress/data/important note?
Android has a fairly complex system that, when simplified a little for the purposes of explanation, means that every app on an Android device is in one of the following phases:
Being created
Starting
Resuming
Running
Pausing
Stopping
Being destroyed
The list of phases will hopefully appear fairly logical. As an example, the user presses the Facebook app icon and the app is created. Then...