List of usage examples for android.os Bundle putParcelableArrayList
public void putParcelableArrayList(@Nullable String key, @Nullable ArrayList<? extends Parcelable> value)
From source file:com.example.julia.popularmovies.details.DetailFragment.java
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); if (mTrailerListAdapter != null) { ArrayList<Trailer> trailers = mTrailerListAdapter.getTrailers(); if (trailers != null && !trailers.isEmpty()) { outState.putParcelableArrayList(EXTRA_TRAILERS, trailers); }/*from ww w . j a v a 2 s. c o m*/ } else { Log.e(LOG_TAG, "mTrailerListAdapter is null"); } if (mTrailersView != null) { outState.putBoolean(TRAILERS_VIEW, mTrailersView.getVisibility() == View.VISIBLE); } if (mReviewListAdapter != null) { ArrayList<Review> reviews = mReviewListAdapter.getReviews(); if (reviews != null && !reviews.isEmpty()) { outState.putParcelableArrayList(EXTRA_REVIEWS, reviews); } } else { Log.e(LOG_TAG, "mReviewListAdapter is null"); } if (mReviewsRecyclerView != null) { outState.putBoolean(REVIEWS_VIEW, mReviewsRecyclerView.getVisibility() == View.VISIBLE); } }
From source file:org.fs.galleon.presenters.ToolsFragmentPresenter.java
@Override public void storeState(Bundle storeState) { if (tempTakenPhoto != null) { storeState.putString(KEY_TEMP_TAKEN_PHOTO, tempTakenPhoto.getAbsolutePath()); }/*from w w w .j av a2 s . co m*/ if (!Collections.isNullOrEmpty(images)) { storeState.putParcelableArrayList(KEY_IMAGE_ENTITIES, new ArrayList<>(images)); } if (!Collections.isNullOrEmpty(pdfs)) { List<String> absolutePaths = StreamSupport.stream(pdfs).map(File::getAbsolutePath) .collect(Collectors.toList()); storeState.putStringArrayList(KEY_PDF_FILES, new ArrayList<>(absolutePaths)); } }
From source file:com.ovrhere.android.currencyconverter.ui.fragments.MainFragment.java
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); synchronized (currencyList) { outState.putParcelableArrayList(KEY_CURRENCY_LIST, (ArrayList<? extends Parcelable>) currencyList); }//from w w w . j a v a 2s .c om if (viewBuilt) { outState.putString(KEY_CURRENCY_VALUE_INPUT, et_currInput.getText().toString()); outState.putBoolean(KEY_CURRENTLY_UPDATING, currentlyUpdating); } }
From source file:com.trogdan.nanospotify.service.MusicService.java
void processTracksRequest() { if (mTrackList != null) { final Intent i = new Intent(STATUS_SERVICE); final Bundle args = new Bundle(); args.putInt(PlayerFragment.PLAYERPLAYTRACK_ARG, mCurrentTrack); args.putParcelableArrayList(PlayerFragment.PLAYERTRACKS_ARG, mTrackList); i.putExtras(args);/* w w w . java 2 s .com*/ mBroadcaster.sendBroadcast(i); } }
From source file:org.sleepydragon.rgbclient.MainFragment.java
@Override public void onSaveInstanceState(final Bundle outState) { LOG.v("onSaveInstanceState()"); super.onSaveInstanceState(outState); outState.putParcelable(KEY_COLOR_STATE, mColorState); synchronized (mCommandQueue) { outState.putParcelableArrayList(KEY_COMMAND_QUEUE, mCommandQueue); }//ww w. jav a 2 s .c o m }
From source file:com.xamoom.android.xamoomcontentblocks.XamoomContentFragment.java
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putString(YOUTUBE_API_KEY, mYoutubeApiKey); outState.putBoolean(SHOW_SPOT_MAP_CONTENT_LINKS, showSpotMapContentLinks); outState.putParcelable(CONTENT, mContent); outState.putParcelableArrayList(CONTENT_BLOCKS, mContentBlocks); outState.putParcelable(ENDUSER_API, mEnduserApi); }
From source file:com.github.chenxiaolong.dualbootpatcher.switcher.ZipFlashingFragment.java
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putParcelableArrayList(EXTRA_PENDING_ACTIONS, mPendingActions); outState.putString(EXTRA_SELECTED_FILE, mSelectedFile); outState.putString(EXTRA_SELECTED_ROM_ID, mSelectedRomId); outState.putString(EXTRA_ZIP_ROM_ID, mZipRomId); outState.putInt(EXTRA_TASK_ID_VERIFY_ZIP, mTaskIdVerifyZip); }
From source file:org.lunci.dumbthing.fragment.MainDisplayFragment.java
@Override public void onSaveInstanceState(Bundle bundle) { super.onSaveInstanceState(bundle); try {/*from w ww .j a v a2 s . co m*/ final ArrayList<DumbModel> models = new ArrayList<>(mAdapter.getCount()); for (int i = 0; i < mAdapter.getCount(); ++i) { models.add(mAdapter.getItem(i)); } bundle.putParcelableArrayList(EXTRA_ITEMS, models); bundle.putInt(EXTRA_CURRENT_INDEX, mViewHolder.getItemSwitcher().getDisplayedChild()); } catch (NullPointerException ex) { ex.printStackTrace(); } }
From source file:de.azapps.mirakel.settings.SettingsActivity.java
@Override protected void onSaveInstanceState(@NonNull final Bundle outState) { super.onSaveInstanceState(outState); //Persist our list and last clicked position if (headers != null && !headers.isEmpty()) { outState.putInt(STATE_CUR_HEADER_POS, currentFragment.ordinal()); outState.putParcelableArrayList(STATE_HEADERS_LIST, headers); }/*from www .j a v a2 s .co m*/ }
From source file:com.example.smsquickform.Homescreen.java
/** * Called when the screen rotates. If this isn't handled, data already generated is no longer available *///from w ww. j av a2 s. co m @Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); MyAdapter adapter = (MyAdapter) (mLstDevices.getAdapter()); ArrayList<BluetoothDevice> list = (ArrayList<BluetoothDevice>) adapter.getEntireList(); if (list != null) { outState.putParcelableArrayList(DEVICE_LIST, list); int selectedIndex = adapter.selectedIndex; outState.putInt(DEVICE_LIST_SELECTED, selectedIndex); } }