You are currently viewing Android Activity Life Cycle | 5 Easy Step
android activity lifecycle

Android Activity Life Cycle | 5 Easy Step

Android activity life cycle is a process of override of custom method. In android studio a activity is a user interaction layout or screen which consist of some function or elements, to use these control user can move one activity to another activity. 

you can’t become a good android developer while you don’t complete concept the Android Activity Life Cycle.

A activity in android is a single screen or frame. When you design your UI you drop widgets on activity to design attractive UI. There are 7 pre-built in class in java below is graph show how to work these class in android activity.

In c ++ , java and VB.Net start with a main () function similar in android studio initial its program an Activity starting with a method which called OnCreate () method.  

android activity lifecycle

7 Method of Android Activity Life Cycle




When a activity is first created


Call when activity is visible to the user


When activity is start launching to to user


When activity not visible to the user


In this method when a user not perform any action on activity then other activity will resume.


Its restart when a activity already stopped.


It done when activity shutdown.

We clear this android activity life cycle with a simple and very basic example “Hello Word” following are the simple step to modify the android studio application. This simple example help you to understand android activity life cycle.

Example :

How To Create your First App

Step 02 : Open your android studio then enter the new package name or application

android activity life cycle

Step 02 : Choose empty activity in your project and then click next.

(Note if you don’t install Android Studio in your PC or laptop so first install this SDK (Software Development Kit) read my previous article how to download and  install Android Studio)

Step 03 :Enter  the name of your app which you want to create its also called package name.

android activity life cycle

 Step 04 :Modify the with following example.

android activity life cycle
package com.example.myfirst_project;


import android.os.Bundle;
import android.util.Log;

public class MainActivity extends AppCompatActivity {

String my_msg = "Android : ";
protected void onCreate(Bundle savedInstanceState) {
Log.d(my_msg, "The OnCreate ()");
protected void onStart() {
Log.d(my_msg, "The onStart() event");
protected void onPause (){
Log.d(my_msg,"The OnPause () method");
protected void onStop (){
Log.d(my_msg,"The onStop () method");
protected void onDestroy (){
Log.d(my_msg,"The onDestroy () method");


Step 03 : Run your application with you mobile or AVD Manager (If your not installed AVD Manager in your android studio first read this how to install and configure AVD Manager in android studio).

What is Manifest.xml file in Android Studio ?

The Manifest.xml file in android studio have the essential information about your application which your are  developing such as packages, services and components of your activity. It perform some of extra features which are  follow :-

  • Internet Permission
  • User Permission setting for example when your user download your application the app can get the permission which you set in this Manifest.xml file such as contact, location, gallery, internet and much more. It depend on application vendor which information he want to get from their users.
  • Setting up start up activity.
  • All API information.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""

<activity android:name=".MainActivity">
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />

android activity life cycle

To learn Android Activity Life Cycle you must have information about the Manifest.xml file. You can find this Manifest.xml file in left side in the project open the app directory and then open the sub directory Manifest. Double click on it and it will be open in right side you can see the code.