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


Java BundleCompat.putBinder方法代码示例

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


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

示例1: Builder

import android.support.v4.app.BundleCompat; //导入方法依赖的package包/类
public Builder(@Nullable CustomTabsSession session) {
    this.mIntent = new Intent("android.intent.action.VIEW");
    this.mMenuItems = null;
    this.mStartAnimationBundle = null;
    this.mActionButtons = null;
    if (session != null) {
        this.mIntent.setPackage(session.getComponentName().getPackageName());
    }

    Bundle bundle = new Bundle();
    BundleCompat.putBinder(bundle, "android.support.customtabs.extra.SESSION", session == null ? null : session.getBinder());
    this.mIntent.putExtras(bundle);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:14,代码来源:CustomTabsIntent.java

示例2: safePutBinderExtra

import android.support.v4.app.BundleCompat; //导入方法依赖的package包/类
/**
 * Inserts a {@link Binder} value into an Intent as an extra.
 *
 * Uses {@link BundleCompat#putBinder()}, but doesn't throw exceptions.
 *
 * @param intent Intent to put the binder into.
 * @param name Key.
 * @param binder Binder object.
 */
@VisibleForTesting
public static void safePutBinderExtra(Intent intent, String name, IBinder binder) {
    if (intent == null) return;
    Bundle bundle = new Bundle();
    try {
        BundleCompat.putBinder(bundle, name, binder);
    } catch (Throwable t) {
        // Catches parceling exceptions.
        Log.e(TAG, "putBinder failed on bundle " + bundle);
    }
    intent.putExtras(bundle);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:22,代码来源:IntentUtils.java

示例3: putCustomTabsExtra

import android.support.v4.app.BundleCompat; //导入方法依赖的package包/类
public static void putCustomTabsExtra(Intent intent) {
    // enable Custom Tabs if supported
    Bundle bundle = new Bundle();
    BundleCompat.putBinder(bundle, EXTRA_CUSTOM_TABS_SESSION, null);
    intent.putExtras(bundle);
    intent.putExtra(EXTRA_ENABLE_URLBAR_HIDING, true);
}
 
开发者ID:ykrank,项目名称:S1-Next,代码行数:8,代码来源:IntentUtil.java

示例4: testDeserializeIBinder

import android.support.v4.app.BundleCompat; //导入方法依赖的package包/类
@Test
public void testDeserializeIBinder() {
    IBinder expectedValue = new Binder();
    BundleCompat.putBinder(bundle(), randomKey(), expectedValue);
    assertEquals(expectedValue, mCoder.deserialize(bundle(), randomKey()));
}
 
开发者ID:Fondesa,项目名称:Lyra,代码行数:7,代码来源:IBinderCoderTest.java

示例5: Builder

import android.support.v4.app.BundleCompat; //导入方法依赖的package包/类
/**
 * Creates a {@link CustomTabsIntent.Builder} object associated with a given
 * {@link CustomTabsSession}.
 *
 * Guarantees that the {@link Intent} will be sent to the same component as the one the
 * session is associated with.
 *
 * @param session The session to associate this Builder with.
 */
public Builder(@Nullable CustomTabsSession session) {
    if (session != null) mIntent.setPackage(session.getComponentName().getPackageName());
    Bundle bundle = new Bundle();
    BundleCompat.putBinder(
            bundle, EXTRA_SESSION, session == null ? null : session.getBinder());
    mIntent.putExtras(bundle);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:17,代码来源:CustomTabsIntent.java

示例6: serialize

import android.support.v4.app.BundleCompat; //导入方法依赖的package包/类
/**
 * Write a field's value into the saved state {@link Bundle}.
 *
 * @param state      {@link Bundle} used to save the state
 * @param key        key retrieved from {@code fieldDeclaringClass#fieldName}
 * @param fieldValue value of field
 */
@Override
public void serialize(@NonNull Bundle state, @NonNull String key, @NonNull IBinder fieldValue) {
    BundleCompat.putBinder(state, key, fieldValue);
}
 
开发者ID:Fondesa,项目名称:Lyra,代码行数:12,代码来源:IBinderCoder.java


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