# PopUpToBuilder

Artifact: [androidx.navigation:navigation-common](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/NavOptionsBuilder.kt+class:androidx.navigation.PopUpToBuilder) Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

*** ** * ** ***


```
@NavOptionsDsl
public final class PopUpToBuilder
```

<br />

*** ** * ** ***

DSL for customizing `https://developer.android.com/reference/androidx/navigation/NavOptionsBuilder#popUpTo(kotlin.String,kotlin.Function1)` operations.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/navigation/PopUpToBuilder#PopUpToBuilder()()` |

| ### Public methods |
|---|---|
| `final boolean` | `https://developer.android.com/reference/androidx/navigation/PopUpToBuilder#getInclusive()()` Whether the `popUpTo` destination should be popped from the back stack. |
| `final boolean` | `https://developer.android.com/reference/androidx/navigation/PopUpToBuilder#getSaveState()()` Whether the back stack and the state of all destinations between the current destination and the `https://developer.android.com/reference/androidx/navigation/NavOptionsBuilder#popUpTo(kotlin.String,kotlin.Function1)` ID should be saved for later restoration via `https://developer.android.com/reference/androidx/navigation/NavOptionsBuilder#restoreState()` or the `restoreState` attribute using the same `https://developer.android.com/reference/androidx/navigation/NavOptionsBuilder#popUpTo(kotlin.String,kotlin.Function1)` ID (note: this matching ID is true if `https://developer.android.com/reference/androidx/navigation/PopUpToBuilder#inclusive()` is true. |
| `final void` | `https://developer.android.com/reference/androidx/navigation/PopUpToBuilder#setInclusive(kotlin.Boolean)(boolean value)` Whether the `popUpTo` destination should be popped from the back stack. |
| `final void` | `https://developer.android.com/reference/androidx/navigation/PopUpToBuilder#setSaveState(kotlin.Boolean)(boolean value)` Whether the back stack and the state of all destinations between the current destination and the `https://developer.android.com/reference/androidx/navigation/NavOptionsBuilder#popUpTo(kotlin.String,kotlin.Function1)` ID should be saved for later restoration via `https://developer.android.com/reference/androidx/navigation/NavOptionsBuilder#restoreState()` or the `restoreState` attribute using the same `https://developer.android.com/reference/androidx/navigation/NavOptionsBuilder#popUpTo(kotlin.String,kotlin.Function1)` ID (note: this matching ID is true if `https://developer.android.com/reference/androidx/navigation/PopUpToBuilder#inclusive()` is true. |

## Public constructors

### PopUpToBuilder

Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

```
public PopUpToBuilder()
```

## Public methods

### getInclusive

Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

```
public final boolean getInclusive()
```

Whether the `popUpTo` destination should be popped from the back stack.

### getSaveState

Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

```
public final boolean getSaveState()
```

Whether the back stack and the state of all destinations between the current destination and the `https://developer.android.com/reference/androidx/navigation/NavOptionsBuilder#popUpTo(kotlin.String,kotlin.Function1)` ID should be saved for later restoration via `https://developer.android.com/reference/androidx/navigation/NavOptionsBuilder#restoreState()` or the `restoreState` attribute using the same `https://developer.android.com/reference/androidx/navigation/NavOptionsBuilder#popUpTo(kotlin.String,kotlin.Function1)` ID (note: this matching ID is true if `https://developer.android.com/reference/androidx/navigation/PopUpToBuilder#inclusive()` is true. If `https://developer.android.com/reference/androidx/navigation/PopUpToBuilder#inclusive()` is false, this matching ID is the id of the last destination that is popped).

### setInclusive

Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

```
public final void setInclusive(boolean value)
```

Whether the `popUpTo` destination should be popped from the back stack.

### setSaveState

Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

```
public final void setSaveState(boolean value)
```

Whether the back stack and the state of all destinations between the current destination and the `https://developer.android.com/reference/androidx/navigation/NavOptionsBuilder#popUpTo(kotlin.String,kotlin.Function1)` ID should be saved for later restoration via `https://developer.android.com/reference/androidx/navigation/NavOptionsBuilder#restoreState()` or the `restoreState` attribute using the same `https://developer.android.com/reference/androidx/navigation/NavOptionsBuilder#popUpTo(kotlin.String,kotlin.Function1)` ID (note: this matching ID is true if `https://developer.android.com/reference/androidx/navigation/PopUpToBuilder#inclusive()` is true. If `https://developer.android.com/reference/androidx/navigation/PopUpToBuilder#inclusive()` is false, this matching ID is the id of the last destination that is popped).