# BundleCompat

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/app/BundleCompat.java+class:androidx.core.app.BundleCompat) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0) Deprecated in [1.11.0](https://developer.android.com/jetpack/androidx/releases/core#1.11.0)

*** ** * ** ***


```
public final class BundleCompat
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
>
> Replaced with `https://developer.android.com/reference/androidx/core/os/BundleCompat`.

Helper for accessing features in `https://developer.android.com/reference/android/os/Bundle.html`.

## Summary

| ### Public methods |
|---|---|
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/IBinder.html` | `@https://developer.android.com/reference/androidx/annotation/ReplaceWith(expression = "bundle.getBinder(key)") [getBinder](https://developer.android.com/reference/androidx/core/app/BundleCompat#getBinder(android.os.Bundle,java.lang.String))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/os/Bundle.html bundle, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html key)` **This method is deprecated.** Call getBinder directly. <br /> |
| `static void` | `@https://developer.android.com/reference/androidx/annotation/ReplaceWith(expression = "bundle.putBinder(key, binder)") [putBinder](https://developer.android.com/reference/androidx/core/app/BundleCompat#putBinder(android.os.Bundle,java.lang.String,android.os.IBinder))( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/os/Bundle.html bundle, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html key, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/IBinder.html binder )` **This method is deprecated.** Call putBinder directly. <br /> |

## Public methods

### getBinder

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0) Deprecated in [1.11.0](https://developer.android.com/jetpack/androidx/releases/core#1.11.0)

```
@ReplaceWith(expression = "bundle.getBinder(key)")
public static @Nullable IBinder [getBinder](https://developer.android.com/reference/androidx/core/app/BundleCompat#getBinder(android.os.Bundle,java.lang.String))(@NonNull Bundle bundle, @Nullable String key)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Call getBinder directly.

A convenience method to handle getting an `https://developer.android.com/reference/android/os/IBinder.html` inside a `https://developer.android.com/reference/android/os/Bundle.html` for all Android versions.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/os/Bundle.html bundle` | The bundle to get the `https://developer.android.com/reference/android/os/IBinder.html`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html key` | The key to use while getting the `https://developer.android.com/reference/android/os/IBinder.html`. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/IBinder.html` | The `https://developer.android.com/reference/android/os/IBinder.html` that was obtained. |

### putBinder

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0) Deprecated in [1.11.0](https://developer.android.com/jetpack/androidx/releases/core#1.11.0)

```
@ReplaceWith(expression = "bundle.putBinder(key, binder)")
public static void [putBinder](https://developer.android.com/reference/androidx/core/app/BundleCompat#putBinder(android.os.Bundle,java.lang.String,android.os.IBinder))(
    @NonNull Bundle bundle,
    @Nullable String key,
    @Nullable IBinder binder
)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Call putBinder directly.

A convenience method to handle putting an `https://developer.android.com/reference/android/os/IBinder.html` inside a `https://developer.android.com/reference/android/os/Bundle.html` for all Android versions.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/os/Bundle.html bundle` | The bundle to insert the `https://developer.android.com/reference/android/os/IBinder.html`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html key` | The key to use while putting the `https://developer.android.com/reference/android/os/IBinder.html`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/IBinder.html binder` | The `https://developer.android.com/reference/android/os/IBinder.html` to put. |