ITZone

Life cycle of Activity in Android application

Today I would like to introduce you to the life cycle of 1 Activity in Android application. Mastering this will help you better understand an Android application and help a lot in the process of developing the application later.

The activities in the system are managed as an activity stack. When a new activity starts it is placed on the top of the stack and becomes a Running Activity (running activity), at the same time the previous activity will be just below it, and will not become visible (see) until the above activity exits the stack. Activity 1 includes 4 main states:

The following image illustrates the life of an Activity along with its statuses:

The status of activity via each method:

There are 3 main loops that you need to know:

So I introduced through the life of an activity, hope you can understand and master this knowledge. Good luck!

Source: https://developer.android.com/reference/android/app/Activity.html

Share the news now