question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 2 years ago
  • Comments:27 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
miduchcommented, May 10, 2022

thanks for helping out. Now it works

1reaction
raamcostacommented, May 10, 2022

Cool, then use popUpTo(NavGraphs.root)

there is an extension function that will accept this directly, no need to do “.route”

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found