mystic mystic - 24 days ago 10
Android Question

What method is called from the backstack

Please what method gets called when an activity is shown again from the backstack after a BackPress on a previous activity. I've tried the onActivityReenter but it doesn't get called as i expected.

Answer

If the Activity isn't destroyed form the OS. Then it would first invoke onRestart(), followed by onStart() and onResume(). If the Activity has been destroyed then it would invoke onCreate() instead of onRestart()

Read more here and here

Here is a diagram of the lifecycle:

enter image description here

Comments