How to work Activity LifeCycle in kotlin with Android Studio.

Kumar Shubhankar
1 min readFeb 21, 2021

we will know about Activity LifeCycle

We will know that when it will work which function.

When we have launched Activity that time it will work:

OnCreate()

OnStart()

OnResume()

Again I am going to minimize the app that time:

OnPause()

OnStop()

Again I am going to minimize to up that time it will work:

OnResart()

OnResume()

OnStart()

Again I am going to back it will work that time:

OnPouse()

OnStop()

OnDestroy()

. onCreate():

In this statement. The activity is created.

.onStart():

This callback method is called when the activity become visible to the user.

.onResume ():

The activity is in the foreground and the user can interact with it.

.onPause():

This is a callback method when the activity is not visible on the screen.

. onStop:

This callback is called when the activity is no longer visible.

. onDestroy():

This callback is called before the activity is destroyed by the system.

. onRestart():

This callback is called when the activity restarts after stopping it.

We have use a gitlab link.

https://gitlab.com/akashkumar.edugaon/activitylifecycledemo.

Thanks for reading 👍

--

--