# Back Handling

Guia provides common use cases for back handling for bottom tab navigation.

### Back to Default Stack

```kotlin
navHost.DefaultStackBackHandler(HomeStackKey)
```

Now whenever we are on a tab that isn't `HomeStackKey` and we click back, the tab will be changed to that key.

### Stack History

```kotlin
navHost.StackHistoryBackHandler()
```

Now whenever we call `setActive` , that handler will remember the sequence of tabs being active and goes back to those tabs as we click back.

### Create your own

None of the back handlers mentioned above using anything internal to the library. They simply check the state of `NavHost.currentEntry` and the navigators' backstacks and react to it to form a back handling strategy. So you're free to create your own back strategy.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://roudi.gitbook.io/guia-navigation/using-guia/the-lore/navhost/back-handling.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
