Guia Navigation
Github
  • Overview
  • Setup
  • Using Guia
    • 📔Express Lore
      • Quick Start
    • 📖The Lore
      • Navigation Key
      • Navigation Node
        • Screen
        • Bottom Sheet
        • Dialog
      • Navigator
        • Navigation Operations
        • Navigator Instance
        • Back Handling
      • Navigator Config
        • Dynamic Navigation Node
        • Transitions
      • Containers
      • NavHost
        • Back Handling
      • Multi module navigation
        • NavHost Multi module
      • Deep Linking / Global Navigation
      • Results
      • Lifecycle, ViewModel, Saved State
      • UI Tests
  • 🤖Advanced
    • Custom LifecycleManager
Powered by GitBook
On this page
  1. Using Guia
  2. The Lore
  3. Navigator

Back Handling

PreviousNavigator InstanceNextNavigator Config

Last updated 2 years ago

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 the back stack as we click back.

We can override back press in our Composables by using NavBackHandler:

@Composable
fun HomeScreen() { 
    NavBackHandler(enabled = true) {
        // Now the navigator will not pop the back stack.
    }
}

You can also initialize the navigator with overrideBackPress = false and use your own logic for back handling based on the backstack.

📖
pops