# AnchorPersistenceMode

Artifact: [androidx.xr.runtime:runtime](https://developer.android.com/jetpack/androidx/releases/xr-runtime) [View Source](https://cs.android.com/search?q=file:androidx/xr/runtime/XrCapabilities.kt+class:androidx.xr.runtime.AnchorPersistenceMode) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

*** ** * ** ***


```
public final class AnchorPersistenceMode
```

<br />

*** ** * ** ***

Feature that allows anchors to be persisted through sessions.

## Summary

| ### Public fields |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/AnchorPersistenceMode` | `https://developer.android.com/reference/androidx/xr/runtime/AnchorPersistenceMode#DISABLED()` Anchors cannot be persisted. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/AnchorPersistenceMode` | `https://developer.android.com/reference/androidx/xr/runtime/AnchorPersistenceMode#LOCAL()` Anchors may be persisted and will be saved in the application's local storage. |

| ### Public methods |
|---|---|
| `final int` | `https://developer.android.com/reference/androidx/xr/runtime/AnchorPersistenceMode#getMode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/xr/runtime/AnchorPersistenceMode#toString()()` Returns a string representation of `https://developer.android.com/reference/androidx/xr/runtime/AnchorPersistenceMode` for debugging. |

## Public fields

### DISABLED

```
public static final @NonNull AnchorPersistenceMode DISABLED
```

Anchors cannot be persisted.

### LOCAL

```
public static final @NonNull AnchorPersistenceMode LOCAL
```

Anchors may be persisted and will be saved in the application's local storage.

Supported runtimes:

- OpenXR

Required permissions: None

## Public methods

### getMode

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
public final int getMode()
```

### toString

```
public @NonNull String toString()
```

Returns a string representation of `https://developer.android.com/reference/androidx/xr/runtime/AnchorPersistenceMode` for debugging.

Note: Not intended for production use.