Uncategorized

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/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

Advertisements
Standard

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s