Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Hi Ed, Thank you so much for these suggestions. I've been reviewing them and merging them in. Hopefully it should be live. I've included a thank you note too in the article.
jb...@google.com <jb...@google.com> #3
Great! Thanks a lot, I'll look for the live updates soon!
Description
If you add Fragment A to the fragment manager without adding to back stack then you add fragment B to the fragment manager with adding to the back stack. When you attempt to use either System or Gesture back to go back to Fragment A, fragment manager incorrectly finishes the Activity.
The reason for this is that when fragment manager starts the predictive back gesture, it immediately removes the transitioning operation from the back stack, then updates the enabled state of its onBackPressedCallback causing it to be disabled. Since there are no enabled callbacks in the onBackPressedDispatcher, it immediately finishes the Activity.
We should still considering the transitioning operation as part of the backstack until it completes.