Example usage for android.os Bundle putParcelableArrayList

List of usage examples for android.os Bundle putParcelableArrayList

Introduction

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

Prototype

public void putParcelableArrayList(@Nullable String key, @Nullable ArrayList<? extends Parcelable> value) 

Source Link

Document

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

Usage

From source file:com.raywenderlich.reposearch.ListFragment.java

public static ListFragment newInstance(ArrayList<Repository> repos) {
    ListFragment fragment = new ListFragment();
    Bundle args = new Bundle();
    args.putParcelableArrayList(SARG_REPOS, repos);
    fragment.setArguments(args);/*w  ww . j  a v a 2 s. c o  m*/
    return fragment;
}

From source file:com.commonsware.android.permreporter.PermissionListFragment.java

static PermissionListFragment newInstance(ArrayList<PermissionInfo> perms) {
    PermissionListFragment frag = new PermissionListFragment();
    Bundle args = new Bundle();

    args.putParcelableArrayList(ARG_PERMS, perms);
    frag.setArguments(args);// w  w w  .  ja v  a 2  s .  c  o  m

    return (frag);
}

From source file:com.foxykeep.datadroidpoc.data.factory.CityListJsonFactory.java

public static Bundle parseResult(String wsResponse) throws DataException {
    ArrayList<City> cityList = new ArrayList<City>();

    try {/*from w ww  .j  a  va2s.  co  m*/
        JSONObject parser = new JSONObject(wsResponse);
        JSONObject jsonRoot = parser.getJSONObject(JSONTag.CITY_LIST_ELEM_CITIES);
        JSONArray jsonPersonArray = jsonRoot.getJSONArray(JSONTag.CITY_LIST_ELEM_CITY);
        int size = jsonPersonArray.length();
        for (int i = 0; i < size; i++) {
            JSONObject jsonPerson = jsonPersonArray.getJSONObject(i);
            City city = new City();

            city.name = jsonPerson.getString(JSONTag.CITY_LIST_ELEM_CITY_NAME);
            city.postalCode = jsonPerson.getString(JSONTag.CITY_LIST_ELEM_CITY_POSTAL_CODE);
            city.state = jsonPerson.getString(JSONTag.CITY_LIST_ELEM_CITY_STATE);
            city.country = jsonPerson.getString(JSONTag.CITY_LIST_ELEM_CITY_COUNTRY);

            cityList.add(city);
        }
    } catch (JSONException e) {
        Log.e(TAG, "JSONException", e);
        throw new DataException(e);
    }

    Bundle bundle = new Bundle();
    bundle.putParcelableArrayList(PoCRequestFactory.BUNDLE_EXTRA_CITY_LIST, cityList);
    return bundle;
}

From source file:com.alexcoliveira1.lighttalesreader.view.NovelListFragment.java

public static NovelListFragment newInstance(LinkedList<Novel> novels) {
    NovelListFragment fragment = new NovelListFragment();

    Bundle args = new Bundle();
    args.putParcelableArrayList("novels", new ArrayList<Parcelable>(novels));
    fragment.setArguments(args);/*from w  w  w .j a  v a2  s. c om*/

    return fragment;
}

From source file:radoslav.yordanov.quizgames.controller.QuizChoiceFragment.java

/**
 * Use this factory method to create a new instance of
 * this fragment using the provided parameters.
 *
 * @param quizChoices Quiz choices.//w  w w.  j  av a2  s . c o m
 * @return A new instance of fragment QuizChoiceFragment.
 */
public static QuizChoiceFragment newInstance(ArrayList<QuizChoice> quizChoices, String quizImage) {
    QuizChoiceFragment fragment = new QuizChoiceFragment();
    Bundle args = new Bundle();
    args.putParcelableArrayList(QUIZ_CHOICES, quizChoices);
    args.putString(QUIZ_IMAGE, quizImage);
    fragment.setArguments(args);
    return fragment;
}

From source file:org.catnut.fragment.GalleryPagerFragment.java

public static GalleryPagerFragment getFragment(int currentIndex, ArrayList<Uri> urls, String actionBarTitle) {
    Bundle args = new Bundle();
    args.putInt(CUR_INDEX, currentIndex);
    args.putParcelableArrayList(URLS, urls);
    args.putString(TITLE, actionBarTitle);
    GalleryPagerFragment fragment = new GalleryPagerFragment();
    fragment.setArguments(args);/*  ww w  .  ja va2s  .  c  o m*/
    return fragment;
}

From source file:net.simonvt.cathode.ui.dialog.ListDialog.java

public static ListDialog newInstance(int title, ArrayList<Item> items, Fragment target) {
    ListDialog dialog = new ListDialog();
    dialog.setTargetFragment(target, 0);

    Bundle args = new Bundle();
    args.putInt(ARG_TITLE, title);//w  w  w . j a  v a2  s . c  o m
    args.putParcelableArrayList(ARG_ITEMS, items);
    dialog.setArguments(args);

    return dialog;
}

From source file:demo.chen.com.androiddemo.fragment.CheeseListFragment.java

public static CheeseListFragment newInstance(ArrayList<BaseItem> arg) {
    CheeseListFragment fragment = new CheeseListFragment();
    Bundle bundle = new Bundle();
    bundle.putParcelableArrayList("list", arg);
    fragment.setArguments(bundle);/*from w  ww.  j av  a 2s .  c  om*/
    return fragment;
}

From source file:org.openhab.habdroid.ui.BindingThingTypesFragment.java

public static BindingThingTypesFragment newInstance(ArrayList<ThingType> thingTypes) {
    BindingThingTypesFragment fragment = new BindingThingTypesFragment();
    Bundle args = new Bundle();
    args.putParcelableArrayList(ARG_THINGTYPES, thingTypes);
    fragment.setArguments(args);// w  w  w  .j  a  v a  2s  . c o  m
    return fragment;
}

From source file:org.mozilla.gecko.tabs.TabHistoryFragment.java

public static TabHistoryFragment newInstance(List<TabHistoryPage> historyPageList, int toIndex) {
    final TabHistoryFragment fragment = new TabHistoryFragment();
    final Bundle args = new Bundle();
    args.putParcelableArrayList(ARG_LIST, (ArrayList<? extends Parcelable>) historyPageList);
    args.putInt(ARG_INDEX, toIndex);//w ww .ja va2  s  .  c  om
    fragment.setArguments(args);
    return fragment;
}