Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
Component used:
Common sense and documentation says:
First, from some weird reason there are two Activity's lifecycle:
getLifecycle()
methodFragmentActivity
, that is correctly coordinated with fragments stateThe public one gets updated to
STARTED
state after fragments are updated to STARTED. It is because this update is not handled in(Fragment)Activity.onStart
, but rather viaonActivityPostStarted
.This has great consequences, especially on
OnBackPressedDispatcher
, which is driven by the STARTED state.E.g. I have:
backPressedDispatcher.addCallback(this) {}
requireActivity().onBackPressed()
;Note: FragmentManager's back-press callbacks are registered properly with the internal lifecycle since FragmentController receive HostCallbacks with it.