Notice that the values in the Lifecycle.State enum do not include a PAUSED state.
There are only five states: CREATED, DESTROYED, INITIALIZED, RESUMED, STARTED. These do not exactly correspond with the normal Activity lifecycle that we all know and love:
ON_CREATE, ON_START, ON_RESUME events in this class are dispatched after the LifecycleOwner's related method returns.
ON_PAUSE, ON_STOP, ON_DESTROY events in this class are dispatched before the LifecycleOwner's related method is called.
The execution of the onPause() is the closing boundary for the RESUMED state.
At this point, the Activity is no longer considered RESUMED and it is certainly not DESTROYED.
Since we don't have a PAUSED state it follows it must now be in the STARTED state.
This is technically true, the Activity hasn't yet stopped but it is no longer resumed.
|