BundleCompat

Added in 1.1.0
Deprecated in 1.11.0

public final class BundleCompat


Helper for accessing features in Bundle.

Summary

Public methods

static @Nullable IBinder

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

static void
putBinder(
    @NonNull Bundle bundle,
    @Nullable String key,
    @Nullable IBinder binder
)

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

Public methods

getBinder

Added in 1.1.0
Deprecated in 1.11.0
public static @Nullable IBinder getBinder(@NonNull Bundle bundle, @Nullable String key)

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

Parameters
@NonNull Bundle bundle

The bundle to get the IBinder.

@Nullable String key

The key to use while getting the IBinder.

Returns
@Nullable IBinder

The IBinder that was obtained.

putBinder

Added in 1.1.0
Deprecated in 1.11.0
public static void putBinder(
    @NonNull Bundle bundle,
    @Nullable String key,
    @Nullable IBinder binder
)

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

Parameters
@NonNull Bundle bundle

The bundle to insert the IBinder.

@Nullable String key

The key to use while putting the IBinder.

@Nullable IBinder binder

The IBinder to put.