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
@ReplaceWith(expression = "bundle.getBinder(key)")
getBinder(@NonNull Bundle bundle, @Nullable String key)

This method is deprecated.

Call getBinder directly.

static void
@ReplaceWith(expression = "bundle.putBinder(key, binder)")
putBinder(
    @NonNull Bundle bundle,
    @Nullable String key,
    @Nullable IBinder binder
)

This method is deprecated.

Call putBinder directly.

Public methods

getBinder

Added in 1.1.0
Deprecated in 1.11.0
@ReplaceWith(expression = "bundle.getBinder(key)")
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
@ReplaceWith(expression = "bundle.putBinder(key, binder)")
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.