Example usage for android.os Bundle putSerializable

List of usage examples for android.os Bundle putSerializable

Introduction

In this page you can find the example usage for android.os Bundle putSerializable.

Prototype

@Override
public void putSerializable(@Nullable String key, @Nullable Serializable value) 

Source Link

Document

Inserts a Serializable value into the mapping of this Bundle, replacing any existing value for the given key.

Usage

From source file:com.google.reviewit.AddReviewerFragment.java

public static AddReviewerFragment create(Class<? extends Fragment> origin) {
    AddReviewerFragment fragment = new AddReviewerFragment();
    Bundle bundle = new Bundle();
    bundle.putSerializable(ORIGIN, origin);
    fragment.setArguments(bundle);//  w  ww  .  java2  s .  co  m
    return fragment;
}

From source file:ca.rmen.android.networkmonitor.app.dialog.DialogFragmentFactory.java

/**
 * Show a visible dialog fragment to choose a folder or file
 *///from w  w w .j  a va2s . co  m
public static void showFileChooserDialog(FragmentActivity activity, File initialFolder, boolean foldersOnly,
        int actionId) {
    Log.v(TAG, "showFileChooserDialog");
    Bundle arguments = new Bundle(3);
    arguments.putInt(EXTRA_ACTION_ID, actionId);
    if (initialFolder != null)
        arguments.putSerializable(FileChooserDialogFragment.EXTRA_FILE_CHOOSER_INITIAL_FOLDER, initialFolder);
    arguments.putBoolean(FileChooserDialogFragment.EXTRA_FILE_CHOOSER_FOLDERS_ONLY, foldersOnly);
    FileChooserDialogFragment result = new FileChooserDialogFragment();
    result.setArguments(arguments);
    result.show(activity.getSupportFragmentManager(), FileChooserDialogFragment.class.getSimpleName());
}

From source file:com.gh4a.fragment.CommitListFragment.java

public static CommitListFragment newInstance(Repository repository, String ref) {

    CommitListFragment f = new CommitListFragment();

    Bundle args = new Bundle();
    args.putString(Constants.Object.REF, ref);
    args.putSerializable("REPOSITORY", repository);
    f.setArguments(args);/*from   w w  w . ja va2 s.co  m*/

    return f;
}

From source file:com.activiti.android.ui.fragments.form.picker.TimePickerFragment.java

public static TimePickerFragment newInstance(String dateId, String fragmentTag, GregorianCalendar calendar) {
    TimePickerFragment bf = new TimePickerFragment();
    Bundle b = new Bundle();
    b.putString(ARGUMENT_DATE_ID, dateId);
    b.putString(ARGUMENT_FRAGMENT_TAG, fragmentTag);
    b.putSerializable(ARGUMENT_DATE, calendar);
    bf.setArguments(b);//from  w  w  w  .  j ava 2s .c  om
    return bf;
}

From source file:cn.edu.zafu.news.ui.main.NewsFragment.java

public static NewsFragment newInstance(Category category) {
    NewsFragment f = new NewsFragment();
    Bundle b = new Bundle();
    b.putSerializable(CATEGORY, category);
    f.setArguments(b);//from w w  w.  j a va2 s  .c  o m
    return f;
}

From source file:net.reichholf.dreamdroid.helpers.enigma2.Timer.java

/**
 * @param mph - A MultiPaneHandler instance
 * @param timer - A timer (ExtendedHashMap)
 * @param target - The target fragment (after saving/cancellation)
 * @param create - set to true if a new timer should be created instead of editing an existing one
 *///from   ww w.  ja  v  a2 s .  c  o  m
public static void edit(MultiPaneHandler mph, ExtendedHashMap timer, Fragment target, boolean create) {
    ExtendedHashMap data = new ExtendedHashMap();

    TimerEditFragment f = new TimerEditFragment();
    Bundle args = new Bundle();
    data.put("timer", timer);
    args.putSerializable(DATA, data);

    String action = create ? DreamDroid.ACTION_CREATE : Intent.ACTION_EDIT;
    args.putString("action", action);

    f.setArguments(args);
    if (target != null) {
        f.setTargetFragment(target, Statics.REQUEST_EDIT_TIMER);
    }
    mph.showDetails(f, true);
}

From source file:com.ben.gank.fragment.WebFragment.java

public static WebFragment newInstance(String id, String title, String url, String type, String who) {
    Bundle bundle = new Bundle();
    bundle.putSerializable(KEY_ID, id);
    bundle.putSerializable(KEY_TITLE, title);
    bundle.putSerializable(KEY_URL, url);
    bundle.putSerializable(KEY_TYPE, type);
    bundle.putSerializable(KEY_WHO, who);
    WebFragment Fragment = new WebFragment();
    Fragment.setArguments(bundle);/*from  w w w . j a  v a  2  s.  co m*/
    return Fragment;
}

From source file:com.duy.pascal.ui.editor.EditorFragment.java

public static EditorFragment newInstance(String filePath) {
    EditorFragment editorFragment = new EditorFragment();
    Bundle bundle = new Bundle();
    bundle.putSerializable(CompileManager.EXTRA_FILE, new File(filePath));
    editorFragment.setArguments(bundle);
    return editorFragment;
}

From source file:at.bitfire.davdroid.ui.CreateCollectionFragment.java

public static CreateCollectionFragment newInstance(Account account, CollectionInfo info) {
    CreateCollectionFragment frag = new CreateCollectionFragment();
    Bundle args = new Bundle(2);
    args.putParcelable(ARG_ACCOUNT, account);
    args.putSerializable(ARG_COLLECTION_INFO, info);
    frag.setArguments(args);//from ww  w  .ja va  2 s.c  om
    return frag;
}

From source file:it.gulch.linuxday.android.fragments.TrackScheduleListFragment.java

public static TrackScheduleListFragment newInstance(Day day, Track track) {
    TrackScheduleListFragment f = new TrackScheduleListFragment();
    Bundle args = new Bundle();
    args.putSerializable(ARG_DAY, day);
    args.putSerializable(ARG_TRACK, track);
    f.setArguments(args);//  ww  w.j  av  a 2 s .  c  om
    return f;
}