Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

BundleCompat

class BundleCompat
kotlin.Any
   ↳ androidx.core.app.BundleCompat

Helper for accessing features in Bundle.

Summary

Public methods
static IBinder?
getBinder(@NonNull bundle: Bundle, @Nullable key: String?)

A convenience method to handle getting an IBinder inside a Bundle for all Android versions.

static Unit
putBinder(@NonNull bundle: Bundle, @Nullable key: String?, @Nullable binder: IBinder?)

A convenience method to handle putting an IBinder inside a Bundle for all Android versions.

Public methods

getBinder

@Nullable static fun getBinder(@NonNull bundle: Bundle, @Nullable key: String?): IBinder?

A convenience method to handle getting an IBinder inside a Bundle for all Android versions.

Parameters
bundle Bundle: The bundle to get the IBinder.
key Bundle: The key to use while getting the IBinder.
Return
IBinder?: The IBinder that was obtained.

putBinder

static fun putBinder(@NonNull bundle: Bundle, @Nullable key: String?, @Nullable binder: IBinder?): Unit

A convenience method to handle putting an IBinder inside a Bundle for all Android versions.

Parameters
bundle Bundle: The bundle to insert the IBinder.
key Bundle: The key to use while putting the IBinder.
binder Bundle: The IBinder to put.