-
Notifications
You must be signed in to change notification settings - Fork 656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NavigationCodelab] Arguments retrieved by navBackStackEntry #302
Comments
Hi, I've commented the restoreState = true line that is part of the solution and the app works properly now. I would like to understand what's happening and why, if this is just a mistake in the codelab and if so what's the proposed solution. Thanks in advance for any support! |
The bug happens because NavHost isn't able to treat the routes "accounts/Checking", "accounts/Home Savings", etc. as different routes, and it is restoring the state of the route ignoring the argument. The best solution for this is set inclusive parameter to true inside the popUpTo call. This way NavHost will see the argument of your route too. popUpTo(this@navigateSingleTopTo.graph.findStartDestination().id) {
saveState = true
inclusive = true
} |
Hi, the accountType retrieved by the navBackStackEntry in the Rally app of the Navigation Codelab only works the first time. Afterwards, no matter which account I click, it goes to the single account I clicked the first time. The accountType value doesn't change :( Any help would be welcomed.
The text was updated successfully, but these errors were encountered: