Last Updated: February 24, 2016
·
2.882K
· ajma

Android Lifecycle for two activities

When one activity starts another activity, when does the onPause/Stop/Destroy run in comparison to the onCreate/Start/Resume of the next activity. I put some logging in and here are the results:

ActivityA.onCreate
ActivityA.onStart
ActivityA.onResume
ActivityA.onPause
ActivityB.onCreate
ActivityB.onStart
ActivityB.onResume
ActivityA.onStop

For official docs about this, see: Coordinating Activities (http://developer.android.com/guide/topics/fundamentals/activities.html#CoordinatingActivities)