Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit fdbdd4ebac69c800031de21aadd3bbc32262cc2f
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu May 14 14:17:00 2020
Update NavBackStackEntry args on nav with singleTop
When navigating with the singleTop option, if the call to navigate
includes new arguments those are currently, ignored by the entry on the
backstack and the original arguments are kept.
We need to replace the original arguments with the new ones on the
back stack entry to reflect the most recent status of the destination.
Test: add test in NavControllerTest
Bug: 156545508
Change-Id: Icf2c92f424f57f815487d52f37383b9b11b42fa4
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.java
https://android-review.googlesource.com/1312022
Branch: androidx-master-dev
commit fdbdd4ebac69c800031de21aadd3bbc32262cc2f
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu May 14 14:17:00 2020
Update NavBackStackEntry args on nav with singleTop
When navigating with the singleTop option, if the call to navigate
includes new arguments those are currently, ignored by the entry on the
backstack and the original arguments are kept.
We need to replace the original arguments with the new ones on the
back stack entry to reflect the most recent status of the destination.
Test: add test in NavControllerTest
Bug: 156545508
Change-Id: Icf2c92f424f57f815487d52f37383b9b11b42fa4
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.java
jb...@google.com <jb...@google.com> #3
This has been fixed internally and will be available in the Navigation 2.3.0-beta01 release.
an...@google.com <an...@google.com> #4
il...@google.com <il...@google.com> #5
We've decided to release a Navigation 2.2.3 bug fix release and will be including this change in that release.
mi...@gmail.com <mi...@gmail.com> #6
There is a bug in NavController (line 1078):
mBackStack.peekLast().getArguments().putAll(args);
When getArguments(). return null, NPE is thrown.
mBackStack.peekLast().getArguments().putAll(args);
When getArguments(). return null, NPE is thrown.
mi...@gmail.com <mi...@gmail.com> #7
Basically this is a case when current (old) fragment was created without arguments, but new navigation event has bundle args.
il...@google.com <il...@google.com> #8
Re #6 - I filed
Description
Component used: Navigation Version used: 2.3.0-alpha06
When navigating to a destination with single top, the arguments could change, but the
NavBackStackEntry
's arguments (because it isn't a new instance ofNavBackStackEntry
) aren't updated. It also means they aren't fed through to anyOnDestinationChangedListener
instances.I would expect that the arguments would be updated and that any listeners would get a callback (the destination wouldn't change, but the arguments would).