android.os.Bundle#putParcelable ( )源码实例Demo

下面列出了android.os.Bundle#putParcelable ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: Telegram   文件: CustomTabsSession.java
/**
 * Updates the visuals for toolbar items. Will only succeed if a custom tab created using this
 * session is in the foreground in browser and the given id is valid.
 * @param id            The id for the item to update.
 * @param icon          The new icon of the toolbar item.
 * @param description   Content description of the toolbar item.
 * @return              Whether the update succeeded.
 * @deprecated Use
 * CustomTabsSession#setSecondaryToolbarViews(RemoteViews, int[], PendingIntent)
 */
@Deprecated
public boolean setToolbarItem(int id, @NonNull Bitmap icon, @NonNull String description) {
    Bundle bundle = new Bundle();
    bundle.putInt(CustomTabsIntent.KEY_ID, id);
    bundle.putParcelable(CustomTabsIntent.KEY_ICON, icon);
    bundle.putString(CustomTabsIntent.KEY_DESCRIPTION, description);

    Bundle metaBundle = new Bundle();
    metaBundle.putBundle(CustomTabsIntent.EXTRA_ACTION_BUTTON_BUNDLE, bundle);
    try {
        return mService.updateVisuals(mCallback, metaBundle);
    } catch (RemoteException e) {
        return false;
    }
}
 
源代码2 项目: react-native-callkeep   文件: RNCallKeepModule.java
@ReactMethod
public void displayIncomingCall(String uuid, String number, String callerName) {
    if (!isConnectionServiceAvailable() || !hasPhoneAccount()) {
        return;
    }

    Log.d(TAG, "displayIncomingCall number: " + number + ", callerName: " + callerName);

    Bundle extras = new Bundle();
    Uri uri = Uri.fromParts(PhoneAccount.SCHEME_TEL, number, null);

    extras.putParcelable(TelecomManager.EXTRA_INCOMING_CALL_ADDRESS, uri);
    extras.putString(EXTRA_CALLER_NAME, callerName);
    extras.putString(EXTRA_CALL_UUID, uuid);

    telecomManager.addNewIncomingCall(handle, extras);
}
 
源代码3 项目: MiBandDecompiled   文件: WeiboMultiMessage.java
public Bundle toBundle(Bundle bundle)
{
    if (textObject != null)
    {
        bundle.putParcelable("_weibo_message_text", textObject);
        bundle.putString("_weibo_message_text_extra", textObject.toExtraMediaString());
    }
    if (imageObject != null)
    {
        bundle.putParcelable("_weibo_message_image", imageObject);
        bundle.putString("_weibo_message_image_extra", imageObject.toExtraMediaString());
    }
    if (mediaObject != null)
    {
        bundle.putParcelable("_weibo_message_media", mediaObject);
        bundle.putString("_weibo_message_media_extra", mediaObject.toExtraMediaString());
    }
    return bundle;
}
 
@OnClick(R.id.displayMessage)
public void showConfirmation() {
    try {
        // Supported options
        // Intents.EXTRA_BACKGROUND_IMAGE  (value should be a Bitmap object)
        // Intents.EXTRA_CONTENT_TYPE
        Bundle options = new Bundle();
        Bitmap background = BitmapFactory.decodeResource(getResources(), R.drawable.thank_you_screen_bg);
        options.putParcelable(Intents.EXTRA_BACKGROUND_IMAGE, background);
        options.putString("FONT_COLOR", "#eef442");
        //secondScreenService.displayMessage("", options);
        // secondScreenService.displayMessage("Happy Friday!", options);
        options.putString(Intents.EXTRA_CONTENT_TYPE, Intents.EXTRA_CONTENT_TYPE_HTML);
        secondScreenService.displayMessage("<h2>Thank You</h2><p>Good-bye!</p>", options);
    } catch (RemoteException e) {
        e.printStackTrace();
    }
}
 
源代码5 项目: rcloneExplorer   文件: CacheConfig.java
@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
    super.onSaveInstanceState(outState);
    if (selectedRemote != null) {
        outState.putParcelable(SAVED_SELECTED_REMOTE, selectedRemote);
    }
    if (remotePath != null) {
        outState.putString(SAVED_REMOTE_PATH, remotePath);
    }
    if (chunkSizeString != null) {
        outState.putString(SAVED_CHUNK_SIZE, chunkSizeString);
    }
    if (infoAgeString != null) {
        outState.putString(SAVED_CACHE_EXPIRY, infoAgeString);
    }
    if (chunkTotalSizeString != null) {
        outState.putString(SAVED_CACHE_SIZE, chunkTotalSizeString);
    }
}
 
源代码6 项目: AndroidMvvm   文件: ViewModelActivity.java
@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    if (viewModel != null) {
        outState.putParcelable(EXTRA_VIEW_MODEL_STATE, viewModel.getInstanceState());
    }
}
 
@Override
protected void onSaveInstanceState(@NonNull Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putBoolean(NULL_ACCESS_TOKEN_STATE, mNullAccessToken);
    outState.putString(ACCESS_TOKEN_STATE, mAccessToken);
    outState.putString(ACCOUNT_NAME_STATE, mAccountName);
    outState.putParcelable(MULTI_REDDIT_STATE, multiReddit);
    outState.putString(MULTI_PATH_STATE, multipath);
}
 
源代码8 项目: V.FlyoutTest   文件: FragmentActivity.java
/**
 * Save all appropriate fragment state.
 */
@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    Parcelable p = mFragments.saveAllState();
    if (p != null) {
        outState.putParcelable(FRAGMENTS_TAG, p);
    }
}
 
/**
 *  Factory method to create new instances
 *
 *  @param file                 File to bind an expiration date
 *  @param chosenDateInMillis   Date chosen when the dialog appears
 *  @return                     New dialog instance
 */
public static ExpirationDatePickerDialogFragment newInstance(OCFile file, long chosenDateInMillis) {
    Bundle arguments = new Bundle();
    arguments.putParcelable(ARG_FILE, file);
    arguments.putLong(ARG_CHOSEN_DATE_IN_MILLIS, chosenDateInMillis);

    ExpirationDatePickerDialogFragment dialog = new ExpirationDatePickerDialogFragment();
    dialog.setArguments(arguments);
    return dialog;
}
 
源代码10 项目: braintree_android   文件: ThreeDSecure.java
private static void performCardinalAuthentication(final BraintreeFragment fragment, final ThreeDSecureLookup threeDSecureLookup) {
    fragment.sendAnalyticsEvent("three-d-secure.verification-flow.started");

    Bundle extras = new Bundle();
    extras.putParcelable(ThreeDSecureActivity.EXTRA_THREE_D_SECURE_LOOKUP, threeDSecureLookup);

    Intent intent = new Intent(fragment.getApplicationContext(), ThreeDSecureActivity.class);
    intent.putExtras(extras);

    fragment.startActivityForResult(intent, BraintreeRequestCodes.THREE_D_SECURE);
}
 
源代码11 项目: AndroidFloatLabel   文件: FloatLabel.java
@Override
protected Parcelable onSaveInstanceState() {
    final Parcelable superState = super.onSaveInstanceState();
    final Bundle saveState = new Bundle();
    saveState.putParcelable(SAVE_STATE_KEY_EDIT_TEXT, mEditText.onSaveInstanceState());
    saveState.putParcelable(SAVE_STATE_KEY_LABEL, mLabel.onSaveInstanceState());
    saveState.putBoolean(SAVE_STATE_KEY_FOCUS, mEditText.isFocused());
    saveState.putBoolean(SAVE_STATE_TAG, true);
    saveState.putParcelable(SAVE_STATE_PARENT, superState);

    return saveState;
}
 
源代码12 项目: android-card-form   文件: InitialValueCheckBox.java
@Override
public Parcelable onSaveInstanceState() {
    Parcelable superState = super.onSaveInstanceState();

    Bundle bundle = new Bundle();
    bundle.putParcelable(EXTRA_SUPER_STATE, superState);
    bundle.putBoolean(EXTRA_CHECKED_VALUE, isChecked());

    return bundle;
}
 
源代码13 项目: biermacht   文件: StyleNotesFragment.java
public static StyleNotesFragment instance(BeerStyle s) {
  // Create the fragment.
  StyleNotesFragment f = new StyleNotesFragment();

  // Store the recipe in the arguments bundle.
  Bundle b = new Bundle();
  b.putParcelable(Constants.KEY_STYLE, s);
  f.setArguments(b);

  // Return the newly created fragment.
  return f;
}
 
源代码14 项目: guideshow   文件: FragmentActivity.java
/**
 * Save all appropriate fragment state.
 */
@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    Parcelable p = mFragments.saveAllState();
    if (p != null) {
        outState.putParcelable(FRAGMENTS_TAG, p);
    }
}
 
源代码15 项目: EhViewer   文件: GalleryCommentsScene.java
@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putLong(KEY_API_UID, mApiUid);
    outState.putString(KEY_API_KEY, mApiKey);
    outState.putLong(KEY_GID, mGid);
    outState.putString(KEY_TOKEN, mToken);
    outState.putParcelable(KEY_COMMENT_LIST, mCommentList);
}
 
源代码16 项目: aptoide-client-v8   文件: HomeFragment.java
@Override public void onSaveInstanceState(Bundle outState) {
  super.onSaveInstanceState(outState);
  if (bundlesList != null) {
    outState.putParcelable(LIST_STATE_KEY, bundlesList.getLayoutManager()
        .onSaveInstanceState());
  }
}
 
源代码17 项目: watchlist   文件: ReviewActivity.java
public void loadDetailFragmentWith(String movieName, Review review) {
    ReviewDetailFragment fragment = new ReviewDetailFragment();
    Bundle args = new Bundle();
    args.putString(WatchlistApp.MOVIE_NAME, movieName);
    args.putParcelable(WatchlistApp.REVIEW_OBJECT, review);
    fragment.setArguments(args);
    getSupportFragmentManager().beginTransaction().replace(R.id.review_detail_container, fragment).commit();
}
 
源代码18 项目: Hews   文件: CommentsFragment.java
@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    mCommentPresenter.saveState(outState);
    outState.putParcelable(KEY_LIST_STATE, rvCommentList.getLayoutManager().onSaveInstanceState());
}
 
@Override
public void onSaveInstanceState( Bundle outState ){
    super.onSaveInstanceState( outState );
    outState.putParcelable( KEY_HISTORY_GROUP, getPresenter().getHistoryItemGroup() );
}
 
源代码20 项目: chaoli-forum-for-android-2   文件: MainActivity.java
@Override
protected void onSaveInstanceState(Bundle outState) {
	outState.putParcelable(LAYOUTMANAGER_STATE,layoutManager.onSaveInstanceState());
	outState.putInt(TOOLBAR_OFFSET, binding.appbar.getOffset());
	super.onSaveInstanceState(outState);
}