Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xxv/android-lifecycle
A diagram of the Android Activity / Fragment lifecycle
https://github.com/xxv/android-lifecycle
Last synced: 3 months ago
JSON representation
A diagram of the Android Activity / Fragment lifecycle
- Host: GitHub
- URL: https://github.com/xxv/android-lifecycle
- Owner: xxv
- Created: 2014-04-18T14:26:22.000Z (almost 11 years ago)
- Default Branch: main
- Last Pushed: 2021-08-19T00:44:07.000Z (over 3 years ago)
- Last Synced: 2024-07-31T21:53:06.999Z (6 months ago)
- Language: Java
- Size: 2.89 MB
- Stars: 5,262
- Watchers: 263
- Forks: 682
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-android-learning - Complete Android Fragment & Activity Lifecycle
README
Complete Android Fragment & Activity Lifecycle
----------------------------------------------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.If you see any discrepancies or errors in this diagram, please submit a pull
request or contact [[email protected]](mailto:[email protected]).## Activity and Fragment Lifecycles
Vector versions suitable for printing: [PDF][] or [SVG][]
![A Complete Android Fragment & Activity Lifecycle](complete_android_fragment_lifecycle.png)
## Activity, Fragment and FragmentManager Lifecycle Integration
Vector versions suitable for printing [PDF2][] or [SVG2][]
![A Integration Of Fragments into Activities via Fragment Manager](android-lifecycle-activity-to-fragments.png)
### Some Notes
This intentionally leaves off user-triggered callbacks (such as
`onOptionsItemSelected()`), focusing on the lifecycle stages that are triggered
by the system, in order to keep the diagram more focused on the parts that are
hard to follow.The canonical format of the diagram is the [Dia][] file. It was then exported
to SVG, hand-tweaked to fix font sizes, and imported into [Inkscape][] to do an
SVG, PDF, and PNG render. I hope to find a better workflow for this going forward;
patches always welcome.### License
This diagram (in all its various forms and renders) is licensed under the
[Creative Commons BY-SA 4.0 license][CC-BY-SA]. If you would like it under a
different Creative Commons license, please contact me and we can figure
something out.[Dia]: http://dia-installer.de/
[Inkscape]: http://inkscape.org/
[PDF]: complete_android_fragment_lifecycle.pdf
[SVG]: complete_android_fragment_lifecycle.svg
[CC-BY-SA]: https://creativecommons.org/licenses/by-sa/4.0/
[PDF2]: android-lifecycle-activity-to-fragments.pdf
[SVG2]: android-lifecycle-activity-to-fragments.svg