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:org.mozilla.gecko.RemoteClientsDialogFragment.java

public static RemoteClientsDialogFragment newInstance(String title, String positiveButtonText,
        ChoiceMode choiceMode, ArrayList<RemoteClient> clients) {
    final RemoteClientsDialogFragment dialog = new RemoteClientsDialogFragment();
    final Bundle args = new Bundle();
    args.putString(KEY_TITLE, title);// w  ww. jav a2 s  .  c  om
    args.putString(KEY_POSITIVE_BUTTON_TEXT, positiveButtonText);
    args.putInt(KEY_CHOICE_MODE, choiceMode.ordinal());
    args.putParcelableArrayList(KEY_CLIENTS, clients);
    dialog.setArguments(args);
    return dialog;
}

From source file:com.ubimobitech.spotifystreamer.PlaybackFragment.java

public static PlaybackFragment newInstance(ArrayList<TrackInfo> tracks, int position) {
    PlaybackFragment fragment = new PlaybackFragment();

    Bundle args = new Bundle();
    args.putParcelableArrayList(TRACKS_ARGS, tracks);
    args.putInt(POSITION_ARGS, position);

    fragment.setArguments(args);/*from   w ww  .  j  a v a 2s  .  c o  m*/

    return fragment;
}

From source file:org.sufficientlysecure.keychain.ui.SettingsKeyserverFragment.java

public static SettingsKeyserverFragment newInstance(ArrayList<ParcelableHkpKeyserver> keyservers) {
    Bundle args = new Bundle();
    args.putParcelableArrayList(ARG_KEYSERVER_ARRAY, keyservers);

    SettingsKeyserverFragment fragment = new SettingsKeyserverFragment();
    fragment.setArguments(args);//  w  w  w  . ja  v  a 2s  .  c  om

    return fragment;
}

From source file:de.janrenz.app.mediathek.ArticlePagerFragment.java

public static ArticlePagerFragment newInstance(int pos, ArrayList<Movie> allItems) {
    ArticlePagerFragment f = new ArticlePagerFragment();
    // Supply index input as an argument.
    Bundle args = new Bundle();
    args.putInt("pos", pos);
    args.putParcelableArrayList("movies", allItems);
    f.setArguments(args);/* ww w .  jav a 2  s  . c  o m*/
    return f;
}

From source file:uk.org.crimetalk.fragments.SearchFragment.java

/**
 * Static factory constructor for the {@link uk.org.crimetalk.fragments.SearchFragment}.
 *
 * @param parcelableArrayList A List of {@link uk.org.crimetalk.fragments.helpers.ArticleListHelper}
 *                            to be searched through
 * @return {@link uk.org.crimetalk.fragments.SearchFragment}
 *///from   ww  w  . ja va2s  . co m
public static SearchFragment newInstance(ArrayList<Parcelable> parcelableArrayList, String query) {

    final SearchFragment searchFragment = new SearchFragment();

    final Bundle bundle = new Bundle();
    bundle.putParcelableArrayList(SearchActivity.ARG_ARTICLE_LIST_HELPER_LIST, parcelableArrayList);
    bundle.putString(ARG_QUERY, query);
    searchFragment.setArguments(bundle);

    return searchFragment;

}

From source file:com.example.maxuan.photoutils.ViewPagerActivity.java

public static void BrowserPhotos(Activity activity, ArrayList<Photo> photos, int index, int maxCount,
        SparseArray<Photo> selectedPhotos) {
    Intent intent = new Intent(activity, ViewPagerActivity.class);
    Bundle bundle = new Bundle();
    bundle.putSparseParcelableArray("selectedPhotos", selectedPhotos);
    bundle.putParcelableArrayList("photos", photos);
    bundle.putInt("position", index);
    bundle.putInt("maxCount", index);
    intent.putExtra("data", bundle);
    activity.startActivityForResult(intent, REQUEST_PAGE_SELECT_CODE);
}

From source file:com.example.android.bitmapfun.ui.SearchStreamGridFragment.java

/**
 * Factory method to generate a new instance of the fragment given an image number.
 *
 * @param imageUrl The image url to load
 * @return A new instance of ImageDetailFragment with imageNum extras
 *///from  w w w .  j  a  v a  2 s .c  o  m
public static SearchStreamGridFragment newInstance(ConnexusStream.List streams, String searchCriteria) {
    final SearchStreamGridFragment f = new SearchStreamGridFragment();

    final Bundle args = new Bundle();
    args.putParcelableArrayList(STREAM_LIST, streams);
    f.setArguments(args);
    args.putString(SEARCH_CRITERIA, searchCriteria);

    return f;
}

From source file:com.mifos.mifosxdroid.online.clientlist.ClientListFragment.java

/**
 * This Method will be called, whenever Parent (Fragment or Activity) will be true and Presenter
 * do not need to make Rest API call to server. Parent (Fragment or Activity) already fetched
 * the clients and for showing, they call ClientListFragment.
 * <p>/*from ww  w .  j av  a 2  s .  c om*/
 * Example : Showing Group Clients.
 *
 * @param clientList       List<Client>
 * @param isParentFragment true
 * @return ClientListFragment
 */
public static ClientListFragment newInstance(List<Client> clientList, boolean isParentFragment) {
    ClientListFragment clientListFragment = new ClientListFragment();
    Bundle args = new Bundle();
    if (isParentFragment && clientList != null) {
        args.putParcelableArrayList(Constants.CLIENTS, (ArrayList<? extends Parcelable>) clientList);
        args.putBoolean(Constants.IS_A_PARENT_FRAGMENT, true);
        clientListFragment.setArguments(args);
    }
    return clientListFragment;
}

From source file:com.mifos.mifosxdroid.online.groupslist.GroupsListFragment.java

/**
 * This Method will be called, whenever isParentFragment will be true
 * and Presenter do not need to make Rest API call to server. Parent (Fragment or Activity)
 * already fetched the groups and for showing, they call GroupsListFragment.
 * <p/>/*  ww  w.ja v  a  2s .co m*/
 * Example : Showing Parent Groups.
 *
 * @param groupList        List<Group>
 * @param isParentFragment true
 * @return GroupsListFragment
 */
public static GroupsListFragment newInstance(List<Group> groupList, boolean isParentFragment) {
    GroupsListFragment groupListFragment = new GroupsListFragment();
    Bundle args = new Bundle();
    if (isParentFragment && groupList != null) {
        args.putParcelableArrayList(Constants.GROUPS, (ArrayList<? extends Parcelable>) groupList);
        args.putBoolean(Constants.IS_A_PARENT_FRAGMENT, true);
        groupListFragment.setArguments(args);
    }
    return groupListFragment;
}

From source file:net.named_data.accessmanager.DrawerFragment.java

public static DrawerFragment newInstance(ArrayList<DrawerItem> items) {
    Bundle drawerParams = new Bundle();
    drawerParams.putParcelableArrayList(DrawerFragment.BUNDLE_PARAMETERS, items);

    DrawerFragment fragment = new DrawerFragment();
    fragment.setArguments(drawerParams);
    fragment.m_shouldHideOptionsMenu = false;
    return fragment;
}