Status Update
Comments
nj...@google.com <nj...@google.com> #2
Hey Ian, this looks like it is navigation/backpress handling related. Could you take a look or reassign accordingly? Thanks!
il...@google.com <il...@google.com>
jb...@google.com <jb...@google.com> #3
This is another example of BackHandler
reaches STARTED
first and ends up with improper nesting.
Description
Jetpack Compose component(s) used: BackHandler
Android Studio Build: Build #AI-231.9392.1.2311.11330709, built on January 19, 2024
Kotlin version: 1.9.22
Steps to Reproduce or Code Sample to Reproduce:
1. Compile & run the attached app
2. tap on the hardware back button => "back handler invoked" is printed, as the BackHandler is called
3. tap on the button that changes the night mode
4. tap on the hardware back button => "onBackPressedDispatcher callback" is printed as the OnBackPressedCallback is called
Expected: As the UI has not changed, the BackHandler should be called even after the night mode has changed
If I remove the BackHandler (in MainFragment.kt), the OnBackPressedCallback is always called.
If I remove the OnBackPressedCallback (in MainActivity.kt), the BackHandler is always called.