Example usage for android.os Bundle putBinder

List of usage examples for android.os Bundle putBinder

Introduction

In this page you can find the example usage for android.os Bundle putBinder.

Prototype

public void putBinder(@Nullable String key, @Nullable IBinder value) 

Source Link

Document

Inserts an IBinder value into the mapping of this Bundle, replacing any existing value for the given key.

Usage

From source file:fi.danielsan.donkino.ui.Navigator.java

public static void startBrowserIntent(@NonNull Activity activity, @NonNull String url) {
    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
    Bundle extras = new Bundle();

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
        extras.putBinder(EXTRA_CUSTOM_TABS_SESSION, null);
    }/* w  ww  .  j  a va  2 s .c om*/
    intent.putExtra(EXTRA_CUSTOM_TABS_TOOLBAR_COLOR, ContextCompat.getColor(activity, R.color.colorPrimary));

    Bundle exitBundle = ActivityOptions
            .makeCustomAnimation(activity, R.anim.slide_in_left, R.anim.slide_out_right).toBundle();
    intent.putExtra(EXTRA_CUSTOM_TABS_EXIT_ANIMATION_BUNDLE, exitBundle);

    Bundle startBundle = ActivityOptions
            .makeCustomAnimation(activity, R.anim.slide_in_right, R.anim.slide_out_left).toBundle();

    intent.putExtras(extras);
    activity.startActivity(intent, startBundle);
}

From source file:androidx.media.MediaController2.java

private void sendCommand(String command, Bundle args, ResultReceiver receiver) {
    if (args == null) {
        args = new Bundle();
    }//from   w ww  .ja v  a 2s.  c  om
    MediaControllerCompat controller;
    ControllerCompatCallback callback;
    synchronized (mLock) {
        controller = mControllerCompat;
        callback = mControllerCompatCallback;
    }
    args.putBinder(ARGUMENT_ICONTROLLER_CALLBACK, callback.getIControllerCallback().asBinder());
    args.putString(ARGUMENT_PACKAGE_NAME, mContext.getPackageName());
    args.putInt(ARGUMENT_UID, Process.myUid());
    args.putInt(ARGUMENT_PID, Process.myPid());
    controller.sendCommand(command, args, receiver);
}