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.example.android.wizardpager.wizard.ui.ProfessorCityFromFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    outState.putParcelableArrayList(ProfessorCityFromFragment.STATES_FROM_KEY, mStates);
    outState.putParcelableArrayList(ProfessorCityFromFragment.CITIES_FROM_KEY, mCities);
    outState.putParcelableArrayList(ProfessorCityFromFragment.TOWNS_FROM_KEY, mTowns);

    outState.putInt(ProfessorCityFromFragment.STATE_FROM_SELECTED_KEY, stateSelectedPosition);
    outState.putInt(ProfessorCityFromFragment.CITY_FROM_SELECTED_KEY, citySelectedPosition);
    outState.putInt(ProfessorCityFromFragment.TOWN_FROM_SELECTED_KEY, townSelectedPosition);
    Log.i("onSaveInstanceState", "onSaveInstanceState launched!");
}

From source file:de.gruenewald.udacity.spotifystreamer.PlaybackFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    outState.putInt(ARG_PLAYBACK_TRACKINDEX, mTrackIndex);
    outState.putParcelableArrayList(ARG_PLAYBACK_DATALIST, mPlaybackEntries);

    super.onSaveInstanceState(outState);
}

From source file:edgargtzg.popularmovies.DiscoverMoviesFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putParcelableArrayList(MOVIE_LIST_KEY, mListOfMovies);
}

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

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    mArticleListAdapter = new ArticleListAdapter(getActivity(), R.layout.row_article_item);

    final ArrayList<ArticleListHelper> articleListHelperList = getArguments()
            .getParcelableArrayList(SearchActivity.ARG_ARTICLE_LIST_HELPER_LIST);

    // Let users know this search will take a long time
    if (articleListHelperList.get(0).getFragmentIdentifier() == ArticleListHelper.PRESSCUTTINGS_FRAGMENT
            && !PreferenceUtils.getUserLearnedPressCuttingsWarning(getActivity())) {

        DialogUtils.getPressCuttingsWarningDialog(getActivity()).show();

    }/*from   ww  w  . ja v  a  2 s .  c  o m*/

    getListView().setOnItemClickListener(this);
    getListView().setOnItemLongClickListener(this);

    final Bundle bundle = new Bundle();
    bundle.putParcelableArrayList(SearchActivity.ARG_ARTICLE_LIST_HELPER_LIST, articleListHelperList);
    bundle.putString(ARG_QUERY, getArguments().getString(ARG_QUERY));

    // Start a load with the new query
    getLoaderManager().initLoader(0, bundle, this);

}

From source file:it.geosolutions.android.map.overlay.managers.SimpleOverlayManager.java

/**
 * save the current status of the layers in the provided bundle
 * @param savedInstanceState//from w  ww. j  ava2  s  .com
 */
public void saveInstanceState(Bundle savedInstanceState) {
    ArrayList<DescribedMarker> markers = getMarkerOverlay().getMarkers();
    savedInstanceState.putParcelableArrayList(MapsActivity.PARAMETERS.MARKERS,
            MarkerUtils.getMarkersDTO(markers));
    savedInstanceState.putBoolean(MARKERS_ENABLED_FLAG, mapView.getOverlays().contains(getMarkerOverlay()));//TODO change for visibility!!!
    savedInstanceState.putBoolean(DATA_ENABLED_FLAG, mapView.getOverlays().contains(getDataOverlay()));
    savedInstanceState.putBoolean(MAPSTORE_ENABLED_FLAG, mapView.getOverlays().contains(getWMSOverlay()));
    savedInstanceState.putSerializable(MAPSTORE_CONFIG, getMapStoreConfig());

}

From source file:com.aikidonord.fragments.FragmentProchainsStages.java

@Override
public void onSaveInstanceState(Bundle outState) {

    outState.putParcelableArrayList("stages", this.lstage);
    super.onSaveInstanceState(outState);

}

From source file:de.uni_koblenz_landau.apow.PatientListFragment.java

@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
    savedInstanceState.putInt(ARG_LAST_EXPANDED, mLastExpandedPosition);
    savedInstanceState.putParcelableArrayList(ARG_PATIENTS, (ArrayList<ListViewItem>) mPatients);
    savedInstanceState.putBoolean(ARG_PROGRESS, mProgress);
    super.onSaveInstanceState(savedInstanceState);
}

From source file:com.ayuget.redface.ui.fragment.PrivateMessageListFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putParcelableArrayList(ARG_PRIVATE_MESSAGES_LIST, displayedPrivateMessages);
    outState.putInt(ARG_LAST_LOADED_PAGE, lastLoadedPage);
}

From source file:com.rubengees.introduction.IntroductionBuilder.java

/**
 * This Method finally start the Activity and displays the provided data.
 *//*from   w  w w .  jav  a  2s.  c  o m*/
public void introduceMyself() {
    check();

    Intent intent = new Intent(context, IntroductionActivity.class);
    Bundle bundle = new Bundle();

    bundle.putParcelableArrayList(BUNDLE_SLIDES, slides);
    bundle.putSerializable(BUNDLE_STYLE, style);
    bundle.putInt(BUNDLE_ORIENTATION, orientation);
    bundle.putBoolean(BUNDLE_SHOW_PREVIOUS_BUTTON, showPreviousButton);
    bundle.putBoolean(BUNDLE_SHOW_INDICATOR, showIndicator);
    bundle.putString(BUNDLE_SKIP_STRING, skipString);
    bundle.putBoolean(BUNDLE_ALLOW_BACK_PRESS, allowBackPress);

    if (skipResource != null) {
        bundle.putInt(BUNDLE_SKIP_RESOURCE, skipResource);
    }

    intent.putExtras(bundle);

    Activity parent = context.getParent();

    if (parent != null) {
        context = parent;
    }

    context.startActivityForResult(intent, INTRODUCTION_REQUEST_CODE);
}

From source file:com.example.android.popularmovies.ui.MoviesFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    ArrayList<Movie> movies = mAdapter.getMovies();
    if (movies != null && !movies.isEmpty()) {
        outState.putParcelableArrayList(MOVIE_DATA, movies);
    }//from  ww w  . j  a v a  2s. com
    outState.putString(MOVIE_SORT, mMovieSort);

    // Needed to avoid confusion, when we back from detail screen (i. e. top rated selected but
    // favorite movies are shown and onCreate was not called in this case).
    if (!mMovieSort.equals(getString(R.string.pref_sort_favorites))) {
        getLoaderManager().destroyLoader(CURSOR_LOADER_ID);
    }
}