I need to popBackStack() to a specific screen that...
# compose
k
I need to popBackStack() to a specific screen that contains Scaffold bottom navigation. Depending on the situation, sometimes it takes two popBackStack's sometimes one to get to the screen. Is there any better way to handle returning to the bottom navigation screen and still keep the bottom navigation state in a situation where I am not sure how many popBackStacks are required?
s
instead of using multiple
popBackStack
calls, you can use
popBackStack
with a destination
w
navigateUp
Try it , but your bottom navigation screen should be the parent screen