List of usage examples for android.os Bundle putParcelableArrayList
public void putParcelableArrayList(@Nullable String key, @Nullable ArrayList<? extends Parcelable> value)
From source file:id.satusatudua.sigap.ui.PictureActivity.java
@Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putParcelableArrayList(KEY_MESSAGES, (ArrayList<Message>) messages); outState.putInt(KEY_POSITION, position); }
From source file:org.strongswan.android.ui.fragment.RemediationInstructionsFragment.java
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putParcelableArrayList(RemediationInstructionsFragment.EXTRA_REMEDIATION_INSTRUCTIONS, mInstructions);//from w w w . j av a 2s. c om outState.putInt(KEY_POSITION, mCurrentPosition); }
From source file:org.solovyev.android.calculator.errors.FixableErrorsActivity.java
@Override protected void onSaveInstanceState(@Nonnull Bundle out) { super.onSaveInstanceState(out); out.putParcelableArrayList(STATE_ERRORS, errors); }
From source file:ar.com.martineo14.spotifystreamer2.ui.fragment.SearchArtistFragment.java
@Override public void onSaveInstanceState(Bundle outState) { outState.putParcelableArrayList(Constants.ARTIST_MODEL_RESULT, artistResultModel); outState.putString(Constants.ARTIST_NAME, artistNameSearch); super.onSaveInstanceState(outState); }
From source file:com.amazonaws.devicefarm.android.referenceapp.Activities.MainActivity.java
/** * Displays a specific fragment from a specific position in the drawer list * @param position//from w w w.j a va 2 s . c om */ private void displayFragment(int position) { Fragment newFragment; //Checks if the fragment has tabs associated with it. if (!data.get(position).isHas_tabs()) { newFragment = FragmentEnum.valueOf(data.get(position).getFragment_id()).getFragment(); } else { newFragment = new TabFragmentContainer(); Bundle args = new Bundle(); args.putParcelableArrayList(getString(R.string.tab_fragment_bundle_key), (ArrayList<? extends Parcelable>) data.get(position).getTabs()); newFragment.setArguments(args); } FragmentManager fragmentManager = getSupportFragmentManager(); FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); fragmentTransaction.replace(R.id.container_body, newFragment); fragmentTransaction.commit(); toolbarTitle.setText(data.get(position).getHeadline()); }
From source file:ar.com.martineo14.spotifystreamer2.ui.fragment.ArtistDetailActivityFragment.java
@Override public void onSaveInstanceState(Bundle outState) { outState.putParcelableArrayList(Constants.TRACK_MODEL_RESULT, tracksModelResult); super.onSaveInstanceState(outState); }
From source file:com.lloydtorres.stately.telegrams.FoldersDialog.java
@Override public void onSaveInstanceState(Bundle outState) { // Save state super.onSaveInstanceState(outState); outState.putParcelableArrayList(FOLDERS_KEY, folders); outState.putInt(SELECTED_KEY, selected); }
From source file:com.example.android.popularmovies.fragments.MovieReviewsFragment.java
@Override public void onSaveInstanceState(Bundle outState) { outState.putParcelableArrayList(REVIEWS_ADAPTER_STATE, mReviewAdapter.getList()); //We need this to recover fragment details on tablet. if (mMovie != null) { outState.putParcelable(MOVIE_ACTIVE, mMovie); }/*from w ww.ja v a 2s .co m*/ super.onSaveInstanceState(outState); }
From source file:com.tonyodev.fetch.Utils.java
static ArrayList<Bundle> cursorToQueryResultList(Cursor cursor, boolean closeCursor, boolean loggingEnabled) { ArrayList<Bundle> requests = new ArrayList<>(); try {//from w ww . j a v a2 s . c o m if (cursor == null || cursor.isClosed()) { return requests; } cursor.moveToFirst(); while (!cursor.isAfterLast()) { long id = cursor.getLong(DatabaseHelper.INDEX_COLUMN_ID); int status = cursor.getInt(DatabaseHelper.INDEX_COLUMN_STATUS); String url = cursor.getString(DatabaseHelper.INDEX_COLUMN_URL); String filePath = cursor.getString(DatabaseHelper.INDEX_COLUMN_FILEPATH); int error = cursor.getInt(DatabaseHelper.INDEX_COLUMN_ERROR); long fileSize = cursor.getLong(DatabaseHelper.INDEX_COLUMN_FILE_SIZE); int priority = cursor.getInt(DatabaseHelper.INDEX_COLUMN_PRIORITY); long downloadedBytes = cursor.getLong(DatabaseHelper.INDEX_COLUMN_DOWNLOADED_BYTES); String headers = cursor.getString(DatabaseHelper.INDEX_COLUMN_HEADERS); ArrayList<Bundle> headersList = headersToBundleList(headers, loggingEnabled); int progress = getProgress(downloadedBytes, fileSize); Bundle bundle = new Bundle(); bundle.putLong(FetchService.EXTRA_ID, id); bundle.putInt(FetchService.EXTRA_STATUS, status); bundle.putString(FetchService.EXTRA_URL, url); bundle.putString(FetchService.EXTRA_FILE_PATH, filePath); bundle.putInt(FetchService.EXTRA_ERROR, error); bundle.putLong(FetchService.EXTRA_DOWNLOADED_BYTES, downloadedBytes); bundle.putLong(FetchService.EXTRA_FILE_SIZE, fileSize); bundle.putInt(FetchService.EXTRA_PROGRESS, progress); bundle.putInt(FetchService.EXTRA_PRIORITY, priority); bundle.putParcelableArrayList(FetchService.EXTRA_HEADERS, headersList); requests.add(bundle); cursor.moveToNext(); } if (closeCursor) { cursor.close(); } } catch (Exception e) { if (loggingEnabled) { e.printStackTrace(); } } return requests; }
From source file:by.zatta.pilight.connection.ConnectionService.java
/** * Send the data to all clients.//from w w w . j av a 2 s .c om * * @param message * The message to send. */ private static void sendMessageToUI(int what, String message) { // Log.v(TAG, "sent message called, clients attached: " + Integer.toString(mClients.size())); Iterator<Messenger> messengerIterator = mClients.iterator(); while (messengerIterator.hasNext()) { Messenger messenger = messengerIterator.next(); try { Bundle bundle = new Bundle(); bundle.setClassLoader(aCtx.getClassLoader()); switch (what) { case MSG_SET_STATUS: // Log.v(TAG, "setting status: " + message); bundle.putString("status", message); Message msg_string = Message.obtain(null, MSG_SET_STATUS); msg_string.setData(bundle); messenger.send(msg_string); break; case MSG_SET_BUNDLE: if (!mDevices.isEmpty()) { // Log.v(TAG, "putting mDevices"); bundle.putParcelableArrayList("config", (ArrayList<? extends Parcelable>) mDevices); Message msg = Message.obtain(null, MSG_SET_BUNDLE); msg.setData(bundle); messenger.send(msg); } break; } } catch (RemoteException e) { Log.w(TAG, "mClients.remove called"); mClients.remove(messenger); } } }