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)
Written by Andrew Ma
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Android
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#