-
-
Save iggym/6452327 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[...] = starting state | |
States: | |
not running (dead) | |
onResume (running) | |
onStop (minimized) | |
onPause (screen off) | |
Launch Application: | |
[not running|onStop] (onCreate|onRestart) -> onStart -> onResume | |
Press Home: | |
[onResume] onPause -> onStop | |
Press Back: | |
If back stack is empty: | |
[onResume] onPause -> onStop -> onDestroy | |
If back stack is not empty: | |
[B.onResume] B.onPause -> B.onStop -> B.onDestroy | |
-> A.onRestart -> A.onStart -> A.onResume | |
If back stack is not empty and previous activity was cleared for memory: | |
[B.onResume] B.onPause -> B.onStop -> B.onDestroy | |
-> A.onCreate -> A.onStart -> A.onResume | |
Turn Off Screen: | |
[onResume] onPause | |
Turn On Screen: | |
[onPause] onResume | |
Calling startActivity: | |
-> B.onCreate -> B.onStart -> B.onResume | |
[A.onResume] A.onPause -> A.onStop | |
Rotating | |
[onResume] onPause -> onStop -> onDestroy -> onCreate -> onStart -> onResume | |
Freeing more memory: | |
[onPause] not running | |
[onStop] not running | |
[onDestroy] not running | |
Edge Cases: | |
onStart -> onStop | |
Open activity (onStart -> onResume) and open a dialog above it (onPause). | |
Press home (onStop) and reopen (onStart). | |
Press home (onStop) | |
No Activities in back stack | |
Pressing back to an activity that was cleared due to memory constraints | |
Reorienting root activity | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment