Understanding Android Activity lifecycle


Usually, an Android application consists of more than one activity. These activities are loosely bounded with each other. It is a good practice to create each activity for a specific task to be performed. For example, in a simple phone dialing application, there might be one activity to show all contacts, one to show full contact details of any specific contact, one for dialing a number, and so on. In all the applications, there is a main activity that behaves as the starting point of the application. This activity starts when the application is launched. Then this activity starts some other activity, which starts another, and so on. Android manages all the activities in a back stack.

android activities back stackIn Android, when one activity is started, the already opened activity is stopped, and this change of activity happens in a flow. The following figure shows the visual flowchart of the Activity lifecycle:

activity lifecycle flow

Based on Learning Android Intents book:
Learning Android Intents

One thought on “Understanding Android Activity lifecycle

Leave a Reply

Your email address will not be published. Required fields are marked *