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.
+ Save this method
Example 1
Project: NanoIconPack   File: SponsorsDialog.java   View Source Code Vote up 6 votes
public static SponsorsDialog newInstance(ArrayList<DonateBean> dataList) {
    SponsorsDialog dialog = new SponsorsDialog();

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

    return dialog;
}
 
Example 2
Project: eBread   File: SettingListActivity.java   View Source Code 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();
    switch(position){
        case 0: // Text details
            SettingTextFragment txtFragment = new SettingTextFragment();
            args.putSerializable("SettingManager", settingsManager);
            txtFragment.setArguments(args);
            getSupportFragmentManager().beginTransaction().replace(R.id.setting_fragment_content, txtFragment).addToBackStack(null).commit();
            break;
        case 1: // Theme details
            SettingThemeFragment thmFragment = new SettingThemeFragment();
            args.putSerializable("SettingManager", settingsManager);
            thmFragment.setArguments(args);
            getSupportFragmentManager().beginTransaction().replace(R.id.setting_fragment_content, thmFragment).addToBackStack(null).commit();
            break;
        case 2: // TTS details
            SettingTTSFragment ttsFragment = new SettingTTSFragment();
            args.putSerializable("SettingManager", settingsManager);
            ttsFragment.setArguments(args);
            getSupportFragmentManager().beginTransaction().replace(R.id.setting_fragment_content, ttsFragment).addToBackStack(null).commit();
            break;
    }
}
 
Example 3
Project: ChromeLikeTabSwitcher   File: TabSwitcherModel.java   View Source Code Vote up 6 votes
@Override
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);
    getContentRecyclerAdapter().saveInstanceState(outState);
}
 
Example 4
Project: editor-sql   File: AppFragment.java   View Source Code Vote up 6 votes
public static AppFragment getInstance(DataType dataType){
    Bundle bundle = new Bundle();
    bundle.putSerializable("datatype", dataType);
    AppFragment appFragment = new AppFragment();
    appFragment.setArguments(bundle);
    return appFragment;
}
 
Example 5
Project: AndroidInAppBilling   File: HomeActivity.java   View Source Code 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);
    activity.finish();
}
 
Example 6
Project: aftercare-app-android   File: DCDashboardActivity.java   View Source Code Vote up 5 votes
@Override
public void onGoalAchieved(DCGoal goal) {
    Fragment fragment = getFragmentManager().findFragmentByTag(DCMessageFragment.TAG);
    if (routine != null || (fragment != null && fragment.isVisible())) {
        return;
    }

    DCGoalDialogFragment goalFragment = new DCGoalDialogFragment();
    Bundle arguments = new Bundle();
    arguments.putSerializable(DCGoalDialogFragment.KEY_GOAL, goal);
    goalFragment.setArguments(arguments);
    goalFragment.show(getFragmentManager(), DCGoalDialogFragment.TAG);
    hideTutorials();
}
 
Example 7
Project: Nearby   File: ShowImageActivity.java   View Source Code Vote up 5 votes
@Override
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));
    f.setArguments(bdl);

    return f;
}
 
Example 8
Project: Tasks   File: EditTaskFragment.java   View Source Code Vote up 5 votes
public static EditTaskFragment getInstance(Task task) {
    EditTaskFragment fragment = new EditTaskFragment();
    Bundle args = new Bundle();
    args.putSerializable(AppConstants.EDIT_EXTRA, task);
    fragment.setArguments(args);
    return fragment;
}
 
Example 9
Project: CXJPadProject   File: OrderServiceFragment.java   View Source Code 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);
    fragment.setArguments(args);
    return fragment;
}
 
Example 10
Project: AndroidProgramming3e   File: DatePickerFragment.java   View Source Code Vote up 5 votes
public static DatePickerFragment newInstance(Date date) {
    Bundle args = new Bundle();
    args.putSerializable(ARG_DATE, date);

    DatePickerFragment fragment = new DatePickerFragment();
    fragment.setArguments(args);
    return fragment;
}
 
Example 11
Project: AndroidDvbDriver   File: ListPickerFragmentDialog.java   View Source Code 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: ConfirmImportSyncDataDialog.java   View Source Code 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);
    fragment.setArguments(args);
    return fragment;
}
 
Example 13
Project: markor   File: DocumentIO.java   View Source Code 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: DisplayChallengeFragment.java   View Source Code 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);
    fragment.setArguments(args);
    return fragment;
}
 
Example 15
Project: javaide   File: SelectProjectFragment.java   View Source Code Vote up 5 votes
public static SelectProjectFragment newInstance(CodeCategory category) {

        Bundle args = new Bundle();
        args.putSerializable("category", category);
        SelectProjectFragment fragment = new SelectProjectFragment();
        fragment.setArguments(args);
        return fragment;
    }
 
Example 16
Project: CodeCompilerApp   File: EditTextDialog.java   View Source Code 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);
    f.setArguments(args);
    return f;
}
 
Example 17
Project: fragmentnav   File: FmEnter.java   View Source Code 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: EditImageActivity.java   View Source Code Vote up 4 votes
@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    CropImageView imageView = findViewById(R.id.cropImageView);
    outState.putSerializable(IMAGE_VIEW_STATE, imageView.getCropImageViewState());
}
 
Example 19
Project: q-mail   File: QuotedMessagePresenter.java   View Source Code 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: BirthdayListViewAdapter.java   View Source Code 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);
}