# PersistableBundleKt

Added in 1.1.0

*** ** * ** ***


```
public final class PersistableBundleKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/PersistableBundle.html` | `https://developer.android.com/reference/androidx/core/os/PersistableBundleKt#persistableBundleOf()()` Returns a new empty `https://developer.android.com/reference/android/os/PersistableBundle.html`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/PersistableBundle.html` | `[persistableBundleOf](https://developer.android.com/reference/androidx/core/os/PersistableBundleKt#persistableBundleOf(kotlin.Array))(@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/lang/Object.html>... pairs)` **This method is deprecated.** This method does not provide type safety at compile time. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/PersistableBundle.html` | `https://developer.android.com/reference/androidx/core/os/PersistableBundleKt#(kotlin.collections.Map).toPersistableBundle()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/lang/Object.html> receiver)` Covert this map to a `https://developer.android.com/reference/android/os/PersistableBundle.html` with the key/value pairs as elements. |

## Public methods

### persistableBundleOf

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/os/PersistableBundle.kt+function:persistableBundleOf) Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/core#1.8.0)

```
public static final @NonNull PersistableBundle persistableBundleOf()
```

Returns a new empty `https://developer.android.com/reference/android/os/PersistableBundle.html`.

### persistableBundleOf

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/os/PersistableBundle.kt+function:persistableBundleOf)

```
public static final @NonNull PersistableBundle [persistableBundleOf](https://developer.android.com/reference/androidx/core/os/PersistableBundleKt#persistableBundleOf(kotlin.Array))(@NonNull Pair<@NonNull String, Object>... pairs)
```

> [!CAUTION]
> **This method is deprecated.**   
> This method does not provide type safety at compile time. Use the platform \`PersistableBundle\` class directly instead.

Returns a new `https://developer.android.com/reference/android/os/PersistableBundle.html` with the given key/value pairs as elements.

Supported value types are `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html`, `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html`, `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html`, `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html`, and `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` and arrays of these types.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | When a value is not a supported type of `https://developer.android.com/reference/android/os/PersistableBundle.html`. |

### toPersistableBundle

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/os/PersistableBundle.kt+function:toPersistableBundle)

```
public static final @NonNull PersistableBundle toPersistableBundle(@NonNull Map<@NonNull String, Object> receiver)
```

Covert this map to a `https://developer.android.com/reference/android/os/PersistableBundle.html` with the key/value pairs as elements.

Supported value types are `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html`, `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html`, `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html`, `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html`, and `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` and arrays of these types.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | When a value is not a supported type of `https://developer.android.com/reference/android/os/PersistableBundle.html`. |