Fixed
Status Update
Comments
il...@google.com <il...@google.com>
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 44991c9a6f7d832decb7a19b9d795f8644bc8503
Author: jbwoods <jbwoods@google.com>
Date: Fri Mar 15 10:58:23 2019
Add NavDirections overload for createOnClickListener in Navigation
Gives developers the convenient option of just passing navDirections to
createOnClickListener instead of manually exactings the ActionID and
Bundle.
Test: ./gradlew checkApi
BUG: 127631752
Change-Id: Icfc3762570ccf5efac83afc0375cbdb8c0acee11
M navigation/runtime/api/2.1.0-alpha01.txt
M navigation/runtime/api/current.txt
M navigation/runtime/src/main/java/androidx/navigation/Navigation.java
https://android-review.googlesource.com/930453
https://goto.google.com/android-sha1/44991c9a6f7d832decb7a19b9d795f8644bc8503
Branch: androidx-master-dev
commit 44991c9a6f7d832decb7a19b9d795f8644bc8503
Author: jbwoods <jbwoods@google.com>
Date: Fri Mar 15 10:58:23 2019
Add NavDirections overload for createOnClickListener in Navigation
Gives developers the convenient option of just passing navDirections to
createOnClickListener instead of manually exactings the ActionID and
Bundle.
Test: ./gradlew checkApi
BUG: 127631752
Change-Id: Icfc3762570ccf5efac83afc0375cbdb8c0acee11
M navigation/runtime/api/2.1.0-alpha01.txt
M navigation/runtime/api/current.txt
M navigation/runtime/src/main/java/androidx/navigation/Navigation.java
il...@google.com <il...@google.com> #3
This has been added internally and will be available in Navigation 2.1.0-alpha01
Description
Version used:android.arch.navigation:navigation-ui:1.0.0-beta01
Devices/Android versions reproduced on: any
Navigation to a fragment destination with SingleTop option breaks back stack. The issue was introduced in beta01 update in commit 45818ac652ba3a43b07f980cf22ab78be886d81d by Ian Lake <ilake@google.com> on Wed Jan 30 10:45:37 2019 -0800.
I believe that the root of the issue is unnecessary "+ 1" in line 25 of androidx.navigation.fragment.FragmentNavigator.java:
ft.addToBackStack(generateBackStackName(mBackStack.size() + 1, destId));
When navigation is performed in SingleTop mode, the last fragment is being replaced making back stack 1 frame smaller.