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:net.named_data.nfd.DrawerFragment.java

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

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

From source file:com.baruckis.nanodegree.spotifystreamer.fragments.PlayerDialogFragment.java

public static PlayerDialogFragment newInstance(ArrayList<CustomTrack> tracksList, Integer index) {
    PlayerDialogFragment playerDialogFragment = new PlayerDialogFragment();
    if (tracksList != null && index != null) {
        Bundle args = new Bundle();
        args.putParcelableArrayList(ARG_TRACKS_LIST, tracksList);
        args.putInt(ARG_SELECTED_TRACK_INDEX, index);
        playerDialogFragment.setArguments(args);
    }//w w w  .jav a 2 s  . c o  m
    return playerDialogFragment;
}

From source file:com.android.msahakyan.fma.fragment.TrackDetailFragment.java

/**
 * Use this factory method to create a new instance of
 * this fragment using the provided parameters.
 *
 * @param tracks The list of tracks in the current {@link com.android.msahakyan.fma.model.Album}
 * @return A new instance of fragment AlbumDetailFragment.
 *///from   w w  w . j  av  a 2 s  . co m
public static TrackDetailFragment newInstance(ArrayList<Item> tracks, int position) {
    TrackDetailFragment fragment = new TrackDetailFragment();
    Bundle args = new Bundle();
    args.putParcelable(KEY_ITEM_PARCEL, tracks.get(position));
    args.putParcelableArrayList(KEY_ITEM_LIST, tracks);
    args.putInt(KEY_ITEM_POSITION, position);
    fragment.setArguments(args);

    return fragment;
}

From source file:org.proninyaroslav.libretorrent.fragments.DetailTorrentFilesFragment.java

public static DetailTorrentFilesFragment newInstance(ArrayList<BencodeFileItem> files,
        ArrayList<Priority> priorities) {
    DetailTorrentFilesFragment fragment = new DetailTorrentFilesFragment();

    Bundle args = new Bundle();
    args.putParcelableArrayList(TAG_FILES, files);
    args.putSerializable(TAG_PRIORITIES, priorities);

    fragment.setArguments(args);//from  ww  w.  ja va 2 s .c o  m

    return fragment;
}

From source file:com.shizhefei.view.multitype.MultiTypeAdapter.java

public static <DATA extends Parcelable> void saveState(String key, MultiTypeAdapter<DATA> adapter,
        Bundle outState, int maxSize) {
    List<DATA> datas = adapter.getData();
    int size = adapter.size();
    int saveCount = maxSize < size ? maxSize : size;
    ArrayList<Parcelable> list = new ArrayList<>(maxSize);
    for (int i = 0; i < saveCount; i++) {
        list.add(datas.get(i));/*from   w w  w.j  a v a  2s.c o m*/
    }
    outState.putParcelableArrayList(key, list);
}

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

/**
 * Creates new instance of this fragment
 *//* w  w w.j  a  v a 2s . co m*/
public static EncryptFilesFragment newInstance(ArrayList<Uri> uris) {
    EncryptFilesFragment frag = new EncryptFilesFragment();

    Bundle args = new Bundle();
    args.putParcelableArrayList(ARG_URIS, uris);
    frag.setArguments(args);

    return frag;
}

From source file:dev.drsoran.moloko.activities.TaskEditMultipleActivity.java

private Bundle createTaskEditMultipleFragmentConfig() {
    final Bundle config = new Bundle();

    config.putParcelableArrayList(Intents.Extras.KEY_TASKS, tasks);

    return config;
}

From source file:org.bitbucket.ntakimura.android.support.fragment.AbstractSettingsFragment.java

@Override
public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    //addPreferencesFromResource(R.xml.settings);

    Bundle args = new Bundle();
    args.putParcelableArrayList(OpenSourceLicenseFragment.EXTRA_OSS, getOpenSourceSoftware());
    mOssFragment = new OpenSourceLicenseFragment();
    mOssFragment.setArguments(args);/*  w ww  .  j av  a2s .  co  m*/

    Bundle policyArgs = new Bundle();
    policyArgs.putInt(Intent.EXTRA_TITLE, R.string.privacy_policy);
    policyArgs.putInt(Intent.EXTRA_TEXT, R.raw.privacypolicy);
    mPrivacyPolicyFragment = new TextDialogFragment();
    mPrivacyPolicyFragment.setArguments(policyArgs);

    Bundle tosArgs = new Bundle();
    tosArgs.putInt(Intent.EXTRA_TITLE, R.string.terms_of_service);
    //tosArgs.putInt(Intent.EXTRA_TEXT, R.raw.termsofservice);
    mTermsOfServiceFragment = new TextDialogFragment();
    mTermsOfServiceFragment.setArguments(tosArgs);

    PreferenceScreen versionPreferences = (PreferenceScreen) getPreferenceScreen()
            .findPreference(getString(R.string.key_settings_about_appinfo));
    try {
        versionPreferences.setSummary((getActivity().getPackageManager()
                .getPackageInfo(getActivity().getPackageName(), 0).versionName));
    } catch (NameNotFoundException e) {
        e.printStackTrace();
    }

}

From source file:com.krayzk9s.imgurholo.ui.ImagePager.java

@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
    savedInstanceState.putParcelableArrayList("imageData", imageData);
    savedInstanceState.putInt("start", pager.getCurrentItem());
    // Always call the superclass so it can save the view hierarchy state
    super.onSaveInstanceState(savedInstanceState);
}

From source file:com.krayzk9s.imgurholo.activities.ImagePagerActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (getActionBar() != null)
        getActionBar().setDisplayHomeAsUpEnabled(true);
    if (savedInstanceState == null) {
        Intent intent = getIntent();/*  w w  w .j  a v  a  2 s .  c  o m*/
        Bundle bundle = new Bundle();
        bundle.putInt("start", intent.getExtras().getInt("start"));
        bundle.putParcelableArrayList("ids", intent.getExtras().getParcelableArrayList("ids"));
        ImagePager imagePager = new ImagePager();
        imagePager.setArguments(bundle);
        FragmentManager fragmentManager = getSupportFragmentManager();
        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
        fragmentTransaction.replace(R.id.frame_layout, imagePager).commit();
    }
}