Android Lifecycle for two activities

Today, I ran into some problems of not understanding how the lifecycle of two activities. When one activity starts another activity, when does the onPause/onStop/onDestroy run in comparison to the onCreate/onStart/onResume 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

Comments !

blogroll

social