Status Update
Comments
ap...@google.com <ap...@google.com> #2
Is this specific to navigation? Or can this be reproduced with another other Composable component?
jb...@google.com <jb...@google.com> #3
It only happens inside of a NavHost. So, yes, it seems to be specific to navigation.
pr...@google.com <pr...@google.com> #4
This was caused by the fix to BackHandler
lifecycle aware. The problem here is that the NavController
registers its lifecycle and added an observer to the Activity
Lifecycle
in composition while the BackHandler
registers its observer on the Activity
Lifecycle
in a DisposbleEffect
. This means that the NavController
will always get Lifecycle callbacks before the BackHandler
, so the components listening the the NavController
's lifecycle (like the NavBackStackEntry) will always get their Lifecycle callbacks before the BackHandler
as well.
This should be addressed by work coming in 2.7 to integrate the BackHandler
into the NavHost
.
Description