mystic mystic - 1 year ago 136
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 Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download