[Solved] what happens on returning previous activity?


Activity A and Activity B,

When you move from Activity A to Activity B the lifecycle is as follows

Activity A
--------------------
onCreate()                    //A
onStart()                       //A 
onResume()                 //A - here user can interact with UI(buttons,views), user click button and it moves to second activity
onPause()                    //A
--------------------
onCreate()                    //Activity B
onStart()                       //B
onResume()                 //B

--------------------
onStop()                       //A - onStop() of Activity A is called after onResume() of Activity B

Now user presses back button in Activity B, then lifecycle as follows

onPause()                    //B
-------------------------------
onStart()                       //A 
onResume()                 //A

onStop()                      //B
onDestroy()                 //B

This is lifecycle flow between two activities

solved what happens on returning previous activity?