Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 5b362a9d4faf1516e201297de99993d1cd3a6d7a
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Mar 01 22:23:32 2023
Make sure clearBackStack clears fragment states
Previously calling clearBackStack on the navController would attempt to
restore and immediately pop the saved state. We were failing to pass
down the restore option and therefore we never restored and popped the
fragment state.
We need to add the correct flags to the clearBackStack calls.
RelNote: "NavController will now correctly clear the back fragment
manager back stack state when calling `clearBackStack()`."
Test: added navControllerWithFragmentTest
Bug: 271190202
Change-Id: Ic1cce69633d6f954f7a2f2600a7426bbb241713f
M navigation/navigation-fragment/src/androidTest/java/androidx/navigation/fragment/NavControllerWithFragmentTest.kt
M navigation/navigation-fragment/src/main/java/androidx/navigation/fragment/FragmentNavigator.kt
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
https://android-review.googlesource.com/2456852
Branch: androidx-main
commit 5b362a9d4faf1516e201297de99993d1cd3a6d7a
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Mar 01 22:23:32 2023
Make sure clearBackStack clears fragment states
Previously calling clearBackStack on the navController would attempt to
restore and immediately pop the saved state. We were failing to pass
down the restore option and therefore we never restored and popped the
fragment state.
We need to add the correct flags to the clearBackStack calls.
RelNote: "NavController will now correctly clear the back fragment
manager back stack state when calling `clearBackStack()`."
Test: added navControllerWithFragmentTest
Bug: 271190202
Change-Id: Ic1cce69633d6f954f7a2f2600a7426bbb241713f
M navigation/navigation-fragment/src/androidTest/java/androidx/navigation/fragment/NavControllerWithFragmentTest.kt
M navigation/navigation-fragment/src/main/java/androidx/navigation/fragment/FragmentNavigator.kt
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
jb...@google.com <jb...@google.com> #3
This has been submitted internally and will be available in the Navigation 2.6.0-alpha07
release.
jb...@google.com <jb...@google.com>
na...@google.com <na...@google.com> #4
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.navigation:navigation-fragment:2.6.0-alpha07
androidx.navigation:navigation-runtime:2.6.0-alpha07
va...@google.com <va...@google.com> #5
Can we please make sure this fix is included in the next google3 drop?
As far as I can see the current candidate (cl/513273531) was cut on March 1st before this fix was submitted.
Description
We need to make sure that calling `clearBackStack()` also clears the `mBackStackStates` in the fragment manager.