# BundleCompat

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/core/app/BundleCompat "View this page in Java")

<br />

```
class BundleCompat
```

<br />

*** ** * ** ***

| **This class is deprecated.**   
|
| Replaced with[androidx.core.os.BundleCompat](https://developer.android.com/reference/kotlin/androidx/core/os/BundleCompat).

Helper for accessing features in[Bundle](https://developer.android.com/reference/android/os/Bundle.html).

## Summary

|                                    ### Public functions                                     |
|---------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `java-static `[IBinder](https://developer.android.com/reference/android/os/IBinder.html)`?` | `@`[ReplaceWith](https://developer.android.com/reference/kotlin/androidx/annotation/ReplaceWith)`(expression = "bundle.getBinder(key)")` ~~[getBinder](https://developer.android.com/reference/kotlin/androidx/core/app/BundleCompat#getBinder(android.os.Bundle,java.lang.String))~~`(bundle: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)`, key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?)` **This function is deprecated.** Call getBinder directly. <br />                                                                                                                   |
| `java-static `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | `@`[ReplaceWith](https://developer.android.com/reference/kotlin/androidx/annotation/ReplaceWith)`(expression = "bundle.putBinder(key, binder)")` ~~[putBinder](https://developer.android.com/reference/kotlin/androidx/core/app/BundleCompat#putBinder(android.os.Bundle,java.lang.String,android.os.IBinder))~~`(bundle: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)`, key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?, binder: `[IBinder](https://developer.android.com/reference/android/os/IBinder.html)`?)` **This function is deprecated.** Call putBinder directly. <br /> |

## Public functions

### 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)")
java-static fun [getBinder](https://developer.android.com/reference/kotlin/androidx/core/app/BundleCompat#getBinder(android.os.Bundle,java.lang.String))(bundle: Bundle, key: String?): IBinder?
```
| **This function is deprecated.**   
|
| Call getBinder directly.

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

|                                         Parameters                                          |
|---------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|
| `bundle: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)          | The bundle to get the[IBinder](https://developer.android.com/reference/android/os/IBinder.html).            |
| `key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?` | The key to use while getting the[IBinder](https://developer.android.com/reference/android/os/IBinder.html). |

|                                    Returns                                    |
|-------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------|
| [IBinder](https://developer.android.com/reference/android/os/IBinder.html)`?` | The[IBinder](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)")
java-static fun [putBinder](https://developer.android.com/reference/kotlin/androidx/core/app/BundleCompat#putBinder(android.os.Bundle,java.lang.String,android.os.IBinder))(bundle: Bundle, key: String?, binder: IBinder?): Unit
```
| **This function is deprecated.**   
|
| Call putBinder directly.

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

|                                         Parameters                                          |
|---------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|
| `bundle: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)          | The bundle to insert the[IBinder](https://developer.android.com/reference/android/os/IBinder.html).         |
| `key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?` | The key to use while putting the[IBinder](https://developer.android.com/reference/android/os/IBinder.html). |
| `binder: `[IBinder](https://developer.android.com/reference/android/os/IBinder.html)`?`     | The[IBinder](https://developer.android.com/reference/android/os/IBinder.html)to put.                        |