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.jwork.dhammapada.SearchFragment.java

public static Fragment newInstance(String query) {
    SearchFragment myFragment = new SearchFragment();
    Bundle args = new Bundle();
    args.putSerializable("query", query);
    myFragment.setArguments(args);//from   w  ww .  j av  a2  s.  c o m
    return myFragment;
}

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

public static TrackScheduleListFragment newInstance(Day day, Track track, long fromEventId) {
    Bundle args = new Bundle();
    args.putSerializable(ARG_DAY, day);
    args.putSerializable(ARG_TRACK, track);
    args.putLong(ARG_FROM_EVENT_ID, fromEventId);

    TrackScheduleListFragment f = new TrackScheduleListFragment();
    f.setArguments(args);/*from   w  w  w . j  a  v a 2s  .c om*/

    return f;
}

From source file:com.seregil13.literarytracker.lightnovel.LightNovelEditFragment.java

/**
 * Creates a new instance of the fragment in create mode with all the pertinent data passed in as
 * parameters.//from  w ww .  j a  v  a 2 s.  co m
 *
 * @return An instance of LightNovelEditFragment.
 */
public static LightNovelEditFragment newCreateInstance() {
    LightNovelEditFragment fragment = new LightNovelEditFragment();
    Bundle arguments = new Bundle();
    arguments.putSerializable(CREATE_OR_EDIT_KEY, Mode.CREATE);

    fragment.setArguments(arguments);
    return fragment;
}

From source file:ca.liquidlabs.android.speedtestvisualizer.fragments.GraphViewMasterFragment.java

/**
 * Creates a graph fragment to draw graphview based on data and graph type.
 * // www.  j av a  2 s  .c  om
 * @param header CSV header for parsing.
 * @param csvData CSV Data for parsing.
 * @param graphType Type of graph to draw. See {@link GraphType}.
 * @return Fragment containing graph.
 */
public static Fragment newInstance(final String header, final String csvData, GraphType graphType) {
    Tracer.debug(LOG_TAG, "newInstance()");
    GraphViewMasterFragment fragment = new GraphViewMasterFragment();
    Bundle bundle = new Bundle();
    bundle.putString(BUNDLE_ARG_HEADER, header);
    bundle.putString(BUNDLE_ARG_DATA, csvData);
    bundle.putSerializable(BUNDLE_ARG_GRAPH_TYPE, graphType);
    fragment.setArguments(bundle);

    return fragment;
}

From source file:com.github.hobbe.android.openkarotz.fragment.RadioTabFragment.java

/**
 * Create a new instance of a radio list fragment for the given group of radio stations.
 * @param group the group of radio stations
 * @return a new fragment//from   www .  j  a va 2s .  c  o  m
 */
public static RadioTabFragment newInstance(RadioGroupModel group) {
    Log.d(LOG_TAG, "New instance of radio tab fragment for group: " + group.getName());

    RadioTabFragment fragment = new RadioTabFragment();

    Bundle bundle = new Bundle();
    bundle.putSerializable(RadioTabFragment.KEY_GROUP, group);

    fragment.setArguments(bundle);

    return fragment;
}

From source file:com.example.parkhere.provider.AddSeekerRoleFragment.java

public static AddSeekerRoleFragment newInstance(User user) {
    AddSeekerRoleFragment fragment = new AddSeekerRoleFragment();
    Bundle bundle = new Bundle();
    bundle.putSerializable(USER_KEY, user);
    fragment.setArguments(bundle);/*from  w  w w . ja v  a2  s .  c o  m*/

    return fragment;
}

From source file:com.jwork.dhammapada.VerseFragment.java

public static Fragment newInstance(Chapter chapter) {
    Bundle args = new Bundle();
    args.putSerializable("chapter", chapter);
    VerseFragment myFragment = new VerseFragment();
    myFragment.setArguments(args);/*from   w  w w.  j a  v a2 s. co m*/
    return myFragment;
}

From source file:com.by_syk.lib.nanoiconpack.dialog.IconDialog.java

public static IconDialog newInstance(IconBean bean, boolean isPick) {
    IconDialog dialog = new IconDialog();

    Bundle bundle = new Bundle();
    bundle.putSerializable("bean", bean);
    bundle.putBoolean("pick", isPick);
    dialog.setArguments(bundle);//  w  ww . jav a2s.c  o m

    return dialog;
}

From source file:com.jwork.dhammapada.VerseFragment.java

public static Fragment newInstance(SearchVerse verse) {
    Bundle args = new Bundle();
    args.putSerializable("chapter", verse.getChapter());
    args.putInt("verseIndex", verse.getIndex());
    if (verse.getQuery() != null) {
        args.putString("searchQuery", verse.getQuery());
    }//from   w  w w  .j  ava 2  s.  co  m
    VerseFragment myFragment = new VerseFragment();
    myFragment.setArguments(args);
    return myFragment;
}

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

public static RepositoryFragment newInstance(Repository repository, String ref) {
    RepositoryFragment f = new RepositoryFragment();

    Bundle args = new Bundle();
    args.putSerializable("REPOSITORY", repository);
    args.putString(Constants.Object.REF, ref);
    f.setArguments(args);/*from www .  j  a  v a2  s. c  om*/

    return f;
}