Back Handling
Each navigator has a overrideBackPress
that is stateful and can be updated to allow overriding the back press. It's set to true
by default and it pops the back stack as we click back.
We can override back press in our Composables by using NavBackHandler
:
You can also initialize the navigator with overrideBackPress = false
and use your own logic for back handling based on the backstack.
Last updated