Java Code Examples for android.os.Bundle.putSerializable()

The following are Jave code examples for showing how to use putSerializable() of the android.os.Bundle class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: NanoIconPack   File:   Source Code and License Vote up 6 votes
public static SponsorsDialog newInstance(ArrayList<DonateBean> dataList) {
    SponsorsDialog dialog = new SponsorsDialog();

    Bundle bundle = new Bundle();
    bundle.putSerializable("data", dataList);

    return dialog;
Example 2
Project: eBread   File:   Source Code and License Vote up 6 votes
 * Opens the fragment that allows to change selected settings
 * @param position integer of selected setting in the list
public void onItemSelected(int position){
    Bundle args = new Bundle();
        case 0: // Text details
            SettingTextFragment txtFragment = new SettingTextFragment();
            args.putSerializable("SettingManager", settingsManager);
            getSupportFragmentManager().beginTransaction().replace(, txtFragment).addToBackStack(null).commit();
        case 1: // Theme details
            SettingThemeFragment thmFragment = new SettingThemeFragment();
            args.putSerializable("SettingManager", settingsManager);
            getSupportFragmentManager().beginTransaction().replace(, thmFragment).addToBackStack(null).commit();
        case 2: // TTS details
            SettingTTSFragment ttsFragment = new SettingTTSFragment();
            args.putSerializable("SettingManager", settingsManager);
            getSupportFragmentManager().beginTransaction().replace(, ttsFragment).addToBackStack(null).commit();
Example 3
Project: ChromeLikeTabSwitcher   File:   Source Code and License Vote up 6 votes
public final void saveInstanceState(@NonNull final Bundle outState) {
    outState.putSerializable(LOG_LEVEL_EXTRA, logLevel);
    outState.putParcelableArrayList(TABS_EXTRA, tabs);
    outState.putBoolean(SWITCHER_SHOWN_EXTRA, switcherShown);
    outState.putInt(SELECTED_TAB_INDEX_EXTRA, selectedTab != null ? indexOf(selectedTab) : -1);
    outState.putIntArray(PADDING_EXTRA, padding);
    outState.putBoolean(APPLY_PADDING_TO_TABS_EXTRA, applyPaddingToTabs);
    outState.putInt(TAB_ICON_ID_EXTRA, tabIconId);
    outState.putParcelable(TAB_ICON_BITMAP_EXTRA, tabIconBitmap);
    outState.putParcelable(TAB_BACKGROUND_COLOR_EXTRA, tabBackgroundColor);
    outState.putInt(TAB_CONTENT_BACKGROUND_COLOR_EXTRA, tabContentBackgroundColor);
    outState.putParcelable(TAB_TITLE_TEXT_COLOR_EXTRA, tabTitleTextColor);
    outState.putInt(TAB_CLOSE_BUTTON_ICON_ID_EXTRA, tabCloseButtonIconId);
    outState.putParcelable(TAB_CLOSE_BUTTON_ICON_BITMAP_EXTRA, tabCloseButtonIconBitmap);
    outState.putInt(TAB_PROGRESS_BAR_COLOR_EXTRA, tabProgressBarColor);
    outState.putBoolean(SHOW_TOOLBARS_EXTRA, showToolbars);
    outState.putCharSequence(TOOLBAR_TITLE_EXTRA, toolbarTitle);
Example 4
Project: editor-sql   File:   Source Code and License Vote up 6 votes
public static AppFragment getInstance(DataType dataType){
    Bundle bundle = new Bundle();
    bundle.putSerializable("datatype", dataType);
    AppFragment appFragment = new AppFragment();
    return appFragment;
Example 5
Project: AndroidInAppBilling   File:   Source Code and License Vote up 5 votes
 * After google payment successfully get response
 * @param purchaseList successful payment receive response

void onPurchasesUpdated(List<Purchase> purchaseList) {
    Intent resultIntent = new Intent();
    Bundle args = new Bundle();
    args.putSerializable("result", (Serializable) purchaseList);
    resultIntent.putExtra("PurchaseBundle", args);
    activity.setResult(Activity.RESULT_OK, resultIntent);
Example 6
Project: aftercare-app-android   File:   Source Code and License Vote up 5 votes
public void onGoalAchieved(DCGoal goal) {
    Fragment fragment = getFragmentManager().findFragmentByTag(DCMessageFragment.TAG);
    if (routine != null || (fragment != null && fragment.isVisible())) {

    DCGoalDialogFragment goalFragment = new DCGoalDialogFragment();
    Bundle arguments = new Bundle();
    arguments.putSerializable(DCGoalDialogFragment.KEY_GOAL, goal);
    goalFragment.setArguments(arguments);, DCGoalDialogFragment.TAG);
Example 7
Project: Nearby   File:   Source Code and License Vote up 5 votes
public Fragment getItem(int position){
    Fragment f;
    final int pattern = position %size;

    f = new ShowImageFragment();
    Bundle bdl = new Bundle(1);
    bdl.putSerializable("url", list.get(pattern));

    return f;
Example 8
Project: Tasks   File:   Source Code and License Vote up 5 votes
public static EditTaskFragment getInstance(Task task) {
    EditTaskFragment fragment = new EditTaskFragment();
    Bundle args = new Bundle();
    args.putSerializable(AppConstants.EDIT_EXTRA, task);
    return fragment;
Example 9
Project: CXJPadProject   File:   Source Code and License Vote up 5 votes
public static OrderServiceFragment newInstance(OrderModel model, boolean ref) {
    OrderServiceFragment fragment = new OrderServiceFragment();
    Bundle args = new Bundle();
    args.putSerializable("args", model);
    args.putBoolean("ref", ref);
    return fragment;
Example 10
Project: AndroidProgramming3e   File:   Source Code and License Vote up 5 votes
public static DatePickerFragment newInstance(Date date) {
    Bundle args = new Bundle();
    args.putSerializable(ARG_DATE, date);

    DatePickerFragment fragment = new DatePickerFragment();
    return fragment;
Example 11
Project: AndroidDvbDriver   File:   Source Code and License Vote up 5 votes
public static <T extends Serializable> void showOneInstanceOnly(FragmentManager fragmentManager, List<T> options) {
    ListPickerFragmentDialog<T> dialog = new ListPickerFragmentDialog<>();

    Bundle args = new Bundle();
    args.putInt(ARGS_SIZE, options.size());
    for (int i = 0; i < options.size(); i++) {
        args.putSerializable(getArgKey(i), options.get(i));

    dialog.showOneInstanceOnly(fragmentManager, DIALOG_TAG, args);
Example 12
Project: chromium-for-android-56-debug-video   File:   Source Code and License Vote up 5 votes
private static ConfirmImportSyncDataDialog newInstance(
        String oldAccountName, String newAccountName, ImportSyncType importSyncType) {

    ConfirmImportSyncDataDialog fragment = new ConfirmImportSyncDataDialog();
    Bundle args = new Bundle();
    args.putString(KEY_OLD_ACCOUNT_NAME, oldAccountName);
    args.putString(KEY_NEW_ACCOUNT_NAME, newAccountName);
    args.putSerializable(KEY_IMPORT_SYNC_TYPE, importSyncType);
    return fragment;
Example 13
Project: markor   File:   Source Code and License Vote up 5 votes
public static Document loadDocument(Context context, Intent arguments, @Nullable Document existingDocument) {
    if (existingDocument != null) {
        return existingDocument;

    Bundle bundle = new Bundle();
    if (arguments.hasExtra(EXTRA_DOCUMENT)) {
        bundle.putSerializable(EXTRA_DOCUMENT, arguments.getSerializableExtra(EXTRA_DOCUMENT));
    } else {
        bundle.putBoolean(EXTRA_ALLOW_RENAME, arguments.getBooleanExtra(EXTRA_ALLOW_RENAME, true));
        bundle.putSerializable(EXTRA_PATH, arguments.getSerializableExtra(EXTRA_PATH));
        bundle.putBoolean(EXTRA_PATH_IS_FOLDER, arguments.getBooleanExtra(EXTRA_PATH_IS_FOLDER, false));
    return loadDocument(context, bundle, existingDocument);
Example 14
Project: Runnest   File:   Source Code and License Vote up 5 votes
 * creates a new instance of this class and initializes some fields
 * @param challenge the challenge to be displayed.
 * @return an instance of this class.
public static DisplayChallengeFragment newInstance(Challenge challenge) {
    DisplayChallengeFragment fragment = new DisplayChallengeFragment();
    Bundle args = new Bundle();
    args.putSerializable(CHALLENGE_TO_BE_DISPLAYED, challenge);
    return fragment;
Example 15
Project: javaide   File:   Source Code and License Vote up 5 votes
public static SelectProjectFragment newInstance(CodeCategory category) {

        Bundle args = new Bundle();
        args.putSerializable("category", category);
        SelectProjectFragment fragment = new SelectProjectFragment();
        return fragment;
Example 16
Project: CodeCompilerApp   File:   Source Code and License Vote up 5 votes
public static EditTextDialog newInstance(final Actions action, final String hint) {
    final EditTextDialog f = new EditTextDialog();
    final Bundle args = new Bundle();
    args.putSerializable("action", action);
    args.putString("hint", hint);
    return f;
Example 17
Project: fragmentnav   File:   Source Code and License Vote up 4 votes
private Bundle setNextAction(Bundle bundle, FmBase.Action action, FragmentIntent... intents){
    bundle.putSerializable(KEY_ACTION, action);
    bundle.putParcelableArray(KEY_ACTION_ARG, intents);
    return bundle;
Example 18
Project: Camera-Roll-Android-App   File:   Source Code and License Vote up 4 votes
protected void onSaveInstanceState(Bundle outState) {
    CropImageView imageView = findViewById(;
    outState.putSerializable(IMAGE_VIEW_STATE, imageView.getCropImageViewState());
Example 19
Project: q-mail   File:   Source Code and License Vote up 4 votes
public void onSaveInstanceState(Bundle outState) {
    outState.putSerializable(STATE_KEY_QUOTED_TEXT_MODE, quotedTextMode);
    outState.putSerializable(STATE_KEY_HTML_QUOTE, quotedHtmlContent);
    outState.putSerializable(STATE_KEY_QUOTED_TEXT_FORMAT, quotedTextFormat);
    outState.putBoolean(STATE_KEY_FORCE_PLAIN_TEXT, forcePlainText);
Example 20
Project: LucaHome-AndroidApplication   File:   Source Code and License Vote up 4 votes
private void navigateToEditActivity(@NonNull final LucaBirthday birthday) {
    Bundle data = new Bundle();
    data.putSerializable(BirthdayService.BirthdayIntent, new BirthdayDto(birthday.GetId(), birthday.GetName(), birthday.GetDate(), birthday.GetGroup(), birthday.GetRemindMe(), BirthdayDto.Action.Update));
    NavigationService.getInstance().NavigateToActivityWithData(_context, BirthdayEditActivity.class, data);