当前位置: 首页>>代码示例>>Java>>正文


Java BundleCompat.getBinder方法代码示例

本文整理汇总了Java中android.support.v4.app.BundleCompat.getBinder方法的典型用法代码示例。如果您正苦于以下问题:Java BundleCompat.getBinder方法的具体用法?Java BundleCompat.getBinder怎么用?Java BundleCompat.getBinder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v4.app.BundleCompat的用法示例。


在下文中一共展示了BundleCompat.getBinder方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onConnected

import android.support.v4.app.BundleCompat; //导入方法依赖的package包/类
public void onConnected() {
    Bundle extras = MediaBrowserCompatApi21.getExtras(this.mBrowserObj);
    if (extras != null) {
        IBinder serviceBinder = BundleCompat.getBinder(extras, MediaBrowserProtocol.EXTRA_MESSENGER_BINDER);
        if (serviceBinder != null) {
            this.mServiceBinderWrapper = new ServiceBinderWrapper(serviceBinder);
            this.mCallbacksMessenger = new Messenger(this.mHandler);
            this.mHandler.setCallbacksMessenger(this.mCallbacksMessenger);
            try {
                this.mServiceBinderWrapper.registerCallbackMessenger(this.mCallbacksMessenger);
            } catch (RemoteException e) {
                Log.i(MediaBrowserCompat.TAG, "Remote error registering client messenger.");
            }
            onServiceConnected(this.mCallbacksMessenger, null, null, null);
        }
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:18,代码来源:MediaBrowserCompat.java

示例2: safeGetBinder

import android.support.v4.app.BundleCompat; //导入方法依赖的package包/类
/**
 * Just like {@link BundleCompat#getBinder()}, but doesn't throw exceptions.
 */
public static IBinder safeGetBinder(Bundle bundle, String name) {
    if (bundle == null) return null;
    try {
        return BundleCompat.getBinder(bundle, name);
    } catch (Throwable t) {
        // Catches un-parceling exceptions.
        Log.e(TAG, "getBinder failed on bundle " + bundle);
        return null;
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:14,代码来源:IntentUtils.java

示例3: getSessionTokenFromIntent

import android.support.v4.app.BundleCompat; //导入方法依赖的package包/类
public static CustomTabsSessionToken getSessionTokenFromIntent(Intent intent) {
    Bundle b = intent.getExtras();
    IBinder binder = BundleCompat.getBinder(b, "android.support.customtabs.extra.SESSION");
    return binder == null ? null : new CustomTabsSessionToken(ICustomTabsCallback.Stub.asInterface(binder));
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:6,代码来源:CustomTabsSessionToken.java

示例4: getSessionTokenFromIntent

import android.support.v4.app.BundleCompat; //导入方法依赖的package包/类
/**
 * Obtain a {@link CustomTabsSessionToken} from an intent. See {@link CustomTabsIntent.Builder}
 * for ways to generate an intent for custom tabs.
 * @param intent The intent to generate the token from. This has to include an extra for
 *               {@link CustomTabsIntent#EXTRA_SESSION}.
 * @return The token that was generated.
 */
public static CustomTabsSessionToken getSessionTokenFromIntent(Intent intent) {
    Bundle b = intent.getExtras();
    IBinder binder = BundleCompat.getBinder(b, CustomTabsIntent.EXTRA_SESSION);
    if (binder == null) return null;
    return new CustomTabsSessionToken(ICustomTabsCallback.Stub.asInterface(binder));
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:14,代码来源:CustomTabsSessionToken.java

示例5: launchAsTrustedWebActivity

import android.support.v4.app.BundleCompat; //导入方法依赖的package包/类
/**
 * Launch the given {@link CustomTabsIntent} as a Trusted Web Activity. The given
 * {@link CustomTabsIntent} should have a valid {@link CustomTabsSession} associated with it
 * during construction. Once the Trusted Web Activity is launched, browser side implementations
 * may have their own fallback behavior (e.g. Showing the page in a custom tab UI with toolbar)
 * based on qualifications listed above or more.
 *
 * @param context {@link Context} to use while launching the {@link CustomTabsIntent}.
 * @param customTabsIntent The {@link CustomTabsIntent} to use for launching the
 *                         Trusted Web Activity. Note that all customizations in the given
 *                         associated with browser toolbar controls will be ignored.
 * @param uri The web page to launch as Trusted Web Activity.
 */
public static void launchAsTrustedWebActivity(@NonNull Context context,
        @NonNull CustomTabsIntent customTabsIntent, @NonNull Uri uri) {
    if (BundleCompat.getBinder(
            customTabsIntent.intent.getExtras(), CustomTabsIntent.EXTRA_SESSION) == null) {
        throw new IllegalArgumentException(
                "Given CustomTabsIntent should be associated with a valid CustomTabsSession");
    }
    customTabsIntent.intent.putExtra(EXTRA_LAUNCH_AS_TRUSTED_WEB_ACTIVITY, true);
    customTabsIntent.launchUrl(context, uri);
}
 
开发者ID:GoogleChrome,项目名称:custom-tabs-client,代码行数:24,代码来源:TrustedWebUtils.java

示例6: getSessionTokenFromIntent

import android.support.v4.app.BundleCompat; //导入方法依赖的package包/类
/**
 * Obtain a {@link CustomTabsSessionToken} from an intent. See {@link CustomTabsIntent.Builder}
 * for ways to generate an intent for custom tabs.
 *
 * @param intent The intent to generate the token from. This has to include an extra for
 *               {@link CustomTabsIntent#EXTRA_SESSION}.
 * @return The token that was generated.
 */
public static CustomTabsSessionToken getSessionTokenFromIntent(Intent intent) {
    Bundle b = intent.getExtras();
    IBinder binder = BundleCompat.getBinder(b, CustomTabsIntent.EXTRA_SESSION);
    if (binder == null) return null;
    return new CustomTabsSessionToken(ICustomTabsCallback.Stub.asInterface(binder));
}
 
开发者ID:plusCubed,项目名称:anticipate,代码行数:15,代码来源:CustomTabsSessionToken.java


注:本文中的android.support.v4.app.BundleCompat.getBinder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。