Pick the fix
The back stack is Home → Cart → Checkout. After a successful checkout, Back should go to Home, not back into Checkout or Cart. Which navigate call is right?
Hint 1 of 1
What should remain under Done?
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A navigate(Done) { popUpTo<Home>() }
Correct. Everything above Home is popped, so Back from Done returns to Home.
Why not the others?
- B
navigate(Done). Back would return to Checkout. - C
navigate(Done) { launchSingleTop = true }. That prevents duplicates of Done, not Checkout staying behind. - D
popBackStack(); navigate(Done). Only Checkout is popped; Cart is still between Home and Done.