After struggling with trying to figure out how various pieces fit together, I've done some research and put together the complete Android Activity/Fragment lifecycle chart. This has two parallel lifecycles (activities and fragments) which are organized vertically by time. Lifecycle stages will occur in the vertical order in which they're displayed, across activities and fragments. In this way, you can see how your fragments interact with your activities.

In addition to the attached image (update this is way out of date), I've also got an SVG: http://staticfree.info/~steve/complete_android_fragment_lifecycle.svg which is suitable for printing.

If this is missing lifecycle steps or is inaccurate in any way, let me know so I can update it!

Update: I've put the diagram on Github so people can submit corrections via pull requests: https://github.com/xxv/android-lifecycle Cheers!

Update: Unfortunately, the image below is waaay out of date now. Please see http://staticfree.info/~steve/complete_android_fragment_lifecycle.png instead

#Android #androiddev  
Photo
Shared publiclyView activity