Fixed
Status Update
Comments
il...@google.com <il...@google.com>
pe...@gmail.com <pe...@gmail.com> #2
Yes, this is correct. Having individual navigation graphs on each activities overrides or disallow up navigation to the main activity.
[Deleted User] <[Deleted User]> #3
I believe I have found the potential problem that is causing this:
// @ androidx.navigation.NavController
// line 124
// Now record the pop operation that we were sent
if (!mBackStack.isEmpty()) {
mBackStack.removeLast();
}
// We never want to leave NavGraphs on the top of the stack
while (!mBackStack.isEmpty()
&& mBackStack.peekLast() instanceof NavGraph) {
popBackStack();
}
the condition in while loop is never satisfied because of the above `if` statement above it has already removed the last item of the mBackStack (which was the NavGraph) and thus popBackStack() is never called again.
// @ androidx.navigation.NavController
// line 124
// Now record the pop operation that we were sent
if (!mBackStack.isEmpty()) {
mBackStack.removeLast();
}
// We never want to leave NavGraphs on the top of the stack
while (!mBackStack.isEmpty()
&& mBackStack.peekLast() instanceof NavGraph) {
popBackStack();
}
the condition in while loop is never satisfied because of the above `if` statement above it has already removed the last item of the mBackStack (which was the NavGraph) and thus popBackStack() is never called again.
pe...@gmail.com <pe...@gmail.com> #4
According to Ian Lake, NavigationUI does not support up navigation yet, that is why this is a feature request.
+Pedro Varela - we don't support navigating up through activities as part of NavigationUI yet, please star the feature request:https://issuetracker.google.com/issues/79993862 (this issue)
+Pedro Varela - we don't support navigating up through activities as part of NavigationUI yet, please star the feature request:
da...@gmail.com <da...@gmail.com> #5
Ian Lake said Up navigation is not supported through activities, only through fragments.
il...@google.com <il...@google.com> #6
With the introduction of AppBarConfiguration, this is now possible with the setupActionBarWithNavController method by using an empty set of top level destinations (to always show the up button) and then overriding onSupportNavigateUp() as per the documentation: https://developer.android.com/topic/libraries/architecture/navigation/navigation-ui#action_bar
I'll leave this bug open as we still need an equivalent API for the Toolbar versions.
I'll leave this bug open as we still need an equivalent API for the Toolbar versions.
il...@google.com <il...@google.com>
il...@google.com <il...@google.com> #7
This allows you to call onSupportNavigateUp() (or super.onSupportNavigateUp() if you're using an ActionBar) from that method to have your Up button transition between activities.
This will be available in 1.0.0-alpha09.
su...@gmail.com <su...@gmail.com> #8
There is Jarks when implementing this way to navigate up between activities.
Description
Version used: 1.0.0-alpha01
Devices/Android versions reproduced on: -
Overriding onSupportNavigateUp() helps with the up button behaviour in the navigation architecture components, which is great. However if you have multiple activities the up button does not navigate up to the previous activity. It would be great if it would support that, especially for the migration to the navigation component.