Android Basics – What is the Activity Lifecycle

Android Activity follows a Lifecycle from its time of creation till it gets destroyed. In this Article you will Learn about the Lifecycle.

As you can see in the attached diagram an Activity starts when its Launched. That’s the time its Constructor is run and object is created.

This is followed by the onCreate method which is responsible for Screen setup.

The next lifecycle method onStart gets called when the Activity becomes visible to the user.

Now an Activity can become invisible for a period of time. This is handled by the onStop method.

If an Activity becomes visible again then onRestart method is called.

Finally when an Activity gets destroyed then onDestroy is called.

Author: Ankur

I am Enthusiastic about Learning new things and sharing my Knowledge. I like programming and have a pretty good background in Computer Science.

2 thoughts on “Android Basics – What is the Activity Lifecycle”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: