How to use popUpTo
See original GitHub issue navController.navigate(destination) {
popUpTo("summary_screen") { inclusive = true }
}
navigator.navigate(destination)
I am using above code to pop summary screen from backstack before navigating but its not working. Am i missing something?
Issue Analytics
- State:
- Created 2 years ago
- Comments:27 (15 by maintainers)
Top Results From Across the Web
Navigate to a destination - Android Developers
app:popUpTo tells the Navigation library to pop some destinations off of the back stack as part of the call to navigate() . The...
Read more >Navigation popUpTo and PopUpToInclusive aren't clearing ...
It said, using app:popUpTo and app:popUpToInclusive="true" is supposed to clear the backstack, yet when I press back on email login screen, ...
Read more >How to proper pop the Login flow from the back stack using ...
The popUpInclusive indicates that the destination from popUpTo will also be removed from the back stack. For the code above, the loginFragment ...
Read more >setPopUpTo does not work as expected with first destination ...
I have tried setting "FragmentB" in a "popUpToInclusive=true" action as both "destination" and "popUpTo", but still I cannot achieve this behavior. Is it ......
Read more >Navigation Architecture: Android Jetpack (Part 2) - Medium
Use of popUpTo and popUpInclusive: When navigating using an action, you can optionally pop additional destinations off of the back stack.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
thanks for helping out. Now it works
Cool, then use popUpTo(NavGraphs.root)
there is an extension function that will accept this directly, no need to do “.route”