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.onebusaway.android.report.ui.Open311ProblemFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    List<AttributeValue> attributeValues = createAttributeValues(mServiceDescription);
    if (attributeValues.size() > 0) {
        outState.putParcelableArrayList(ATTRIBUTES, (ArrayList<? extends Parcelable>) attributeValues);
    }/*from w ww. j av  a2 s. c om*/

    if (mImagePath != null) {
        outState.putParcelable(IMAGE_URI, mCapturedImageURI);
        outState.putString(IMAGE_PATH, mImagePath);
        Bitmap bitmap = ((BitmapDrawable) mIssueImageView.getDrawable()).getBitmap();
        outState.putParcelable(IMAGE_THUMBNAIL, bitmap);
    }

    if (mArrivalInfo != null) {
        outState.putSerializable(TRIP_INFO, mArrivalInfo);
    }
    if (mIsProgressDialogShowing) {
        // Dismiss the progress dialog when orientation change to prevent leaked window
        mProgressDialog.dismiss();
    }
    outState.putBoolean(SHOW_PROGRESS_DIALOG, mIsProgressDialogShowing);
    outState.putString(AGENCY_NAME, mAgencyName);
}

From source file:com.arkami.myidkey.activity.KeyCardEditActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putParcelable("keyCard", keyCard);
    outState.putBoolean("isInEditMode", isInEditMode);
    outState.putParcelableArrayList("componentHolder",
            (ArrayList<? extends Parcelable>) componentHolder.getCustomComponents());
    outState.putParcelable("photoUri", photoUri);
    Log.w("onSaveInstanceState", "called");
}

From source file:com.keylesspalace.tusky.activity.ComposeActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    ArrayList<SavedQueuedMedia> savedMediaQueued = new ArrayList<>();
    for (QueuedMedia item : mediaQueued) {
        savedMediaQueued.add(new SavedQueuedMedia(item.type, item.uri, item.preview, item.mediaSize));
    }//from   www .jav a 2s .c om
    outState.putParcelableArrayList("savedMediaQueued", savedMediaQueued);
    outState.putBoolean("showMarkSensitive", showMarkSensitive);
    outState.putString("statusVisibility", statusVisibility);
    outState.putBoolean("statusMarkSensitive", statusMarkSensitive);
    outState.putBoolean("statusHideText", statusHideText);
    outState.putParcelable("textEditorState", saveTextEditorState());
    if (currentInputContentInfo != null) {
        outState.putParcelable("commitContentInputContentInfo", (Parcelable) currentInputContentInfo.unwrap());
        outState.putInt("commitContentFlags", currentFlags);
    }
    currentInputContentInfo = null;
    currentFlags = 0;
    super.onSaveInstanceState(outState);
}

From source file:com.psiphon3.psiphonlibrary.TunnelManager.java

private Bundle getDataTransferStatsBundle() {
    Bundle data = new Bundle();
    data.putLong(DATA_TRANSFER_STATS_CONNECTED_TIME,
            DataTransferStats.getDataTransferStatsForService().m_connectedTime);
    data.putLong(DATA_TRANSFER_STATS_TOTAL_BYTES_SENT,
            DataTransferStats.getDataTransferStatsForService().m_totalBytesSent);
    data.putLong(DATA_TRANSFER_STATS_TOTAL_BYTES_RECEIVED,
            DataTransferStats.getDataTransferStatsForService().m_totalBytesReceived);
    data.putParcelableArrayList(DATA_TRANSFER_STATS_SLOW_BUCKETS,
            DataTransferStats.getDataTransferStatsForService().m_slowBuckets);
    data.putLong(DATA_TRANSFER_STATS_SLOW_BUCKETS_LAST_START_TIME,
            DataTransferStats.getDataTransferStatsForService().m_slowBucketsLastStartTime);
    data.putParcelableArrayList(DATA_TRANSFER_STATS_FAST_BUCKETS,
            DataTransferStats.getDataTransferStatsForService().m_fastBuckets);
    data.putLong(DATA_TRANSFER_STATS_FAST_BUCKETS_LAST_START_TIME,
            DataTransferStats.getDataTransferStatsForService().m_fastBucketsLastStartTime);
    return data;/*from  w w  w.jav  a  2 s . co  m*/
}

From source file:com.facebook.samples.booleanog.LogicActivity.java

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

    outState.putInt(SAVE_LEFT_OPERAND_SELECTION, leftSpinner.getSelectedItemPosition());
    outState.putInt(SAVE_RIGHT_OPERAND_SELECTION, rightSpinner.getSelectedItemPosition());
    outState.putInt(SAVE_CONTENT_SELECTION, contentSpinner.getSelectedItemPosition());
    outState.putString(SAVE_RESULT_TEXT, resultText.getText().toString());
    outState.putString(SAVE_POST_RESULT_TEXT, postResultText.getText().toString());
    outState.putString(SAVE_ACTIVE_TAB, activeTab);
    outState.putBundle(SAVE_PENDING, pendingPost);
    outState.putParcelableArrayList(SAVE_FRIEND_ACTIONS, friendActionList);
}

From source file:com.qiscus.sdk.ui.fragment.QiscusBaseChatFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putParcelable(CHAT_ROOM_DATA, qiscusChatRoom);
    ArrayList<QiscusComment> comments = new ArrayList<>();
    int size = chatAdapter.getData().size();
    for (int i = 0; i < size; i++) {
        comments.add((QiscusComment) chatAdapter.getData().get(i));
    }/*w  ww  .  j a  va2 s  . c o m*/
    outState.putParcelableArrayList(COMMENTS_DATA, comments);
}

From source file:com.fa.mastodon.activity.ComposeActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    ArrayList<SavedQueuedMedia> savedMediaQueued = new ArrayList<>();
    for (QueuedMedia item : mediaQueued) {
        savedMediaQueued.add(new SavedQueuedMedia(item.type, item.uri, item.preview, item.mediaSize));
    }//  www  .j a v a  2s  . c o m
    outState.putParcelableArrayList("savedMediaQueued", savedMediaQueued);
    outState.putBoolean("showMarkSensitive", showMarkSensitive);
    outState.putString("statusVisibility", statusVisibility);
    outState.putBoolean("statusMarkSensitive", statusMarkSensitive);
    outState.putBoolean("statusHideText", statusHideText);
    if (currentInputContentInfo != null) {
        outState.putParcelable("commitContentInputContentInfo", (Parcelable) currentInputContentInfo.unwrap());
        outState.putInt("commitContentFlags", currentFlags);
    }
    currentInputContentInfo = null;
    currentFlags = 0;
    super.onSaveInstanceState(outState);
}

From source file:de.vanita5.twittnuker.activity.support.ComposeActivity.java

@Override
public void onSaveInstanceState(final Bundle outState) {
    outState.putLongArray(EXTRA_ACCOUNT_IDS, mSendAccountIds);
    outState.putParcelableArrayList(EXTRA_MEDIAS, new ArrayList<Parcelable>(getMediasList()));
    outState.putBoolean(EXTRA_IS_POSSIBLY_SENSITIVE, mIsPossiblySensitive);
    outState.putParcelable(EXTRA_STATUS, mInReplyToStatus);
    outState.putLong(EXTRA_STATUS_ID, mInReplyToStatusId);
    outState.putParcelable(EXTRA_USER, mMentionUser);
    outState.putParcelable(EXTRA_DRAFT, mDraftItem);
    outState.putBoolean(EXTRA_SHOULD_SAVE_ACCOUNTS, mShouldSaveAccounts);
    outState.putString(EXTRA_ORIGINAL_TEXT, mOriginalText);
    outState.putParcelable(EXTRA_TEMP_URI, mTempPhotoUri);
    super.onSaveInstanceState(outState);
}

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

@Override
public void onSaveInstanceState(Bundle outState) {

    /*/*from www  .jav a 2 s  .c o  m*/
    * When fragment is destroyed it is needed to store tracks list for easy
    * restoration without call to the web. Also it is needed to store artist id and
    * artist name, because when error is shown and restoration is done if user would
    * decide to press "Try Again" button, than a new call to the web would require
    * these values.
    * */

    if (mCountryCode != null) {
        outState.putString(ARG_COUNTRY_CODE, mCountryCode);
    }

    // store artist id required for the call
    if (mArtistId != null) {
        outState.putString(ARG_ACTIVATED_ARTIST_ID, mArtistId);
    }
    // store artist name which will be recreated for the subtitle
    if (mArtistName != null) {
        outState.putString(ARG_ACTIVATED_ARTIST_NAME, mArtistName);
    }
    // check if error message is shown and save state if it is
    if (mInfoView != null && mInfoView.getIsError()) {
        outState.putBoolean(InfoView.STATE_IS_ERROR, mInfoView.getIsError());

    } else if (mTracksList != null) {
        // if everything is ok (no error screen) than store tracks list
        outState.putParcelableArrayList(STATE_TRACKS_LIST, mTracksList);
    }

    super.onSaveInstanceState(outState);
}

From source file:com.apptentive.android.sdk.module.messagecenter.view.MessageCenterActivityContent.java

@Override
public void onFinishComposing() {
    messageCenterListAdapter.setForceShowKeyboard(false);
    Util.hideSoftKeyboard(viewActivity, viewActivity.findViewById(android.R.id.content));
    if (contextualMessage != null) {
        unsendMessagesCount++;/*  w ww . j a v  a 2s. c  om*/
        MessageManager.sendMessage(viewActivity.getApplicationContext(), contextualMessage);
        contextualMessage = null;
    }
    Editable content = getPendingComposingContent();
    final String messageText = (content != null) ? content.toString().trim() : "";
    final ArrayList<ImageItem> messageAttachments = new ArrayList<ImageItem>();
    messageAttachments.addAll(imageAttachmentstList);
    // Close all composing UI
    clearComposingUi(new Animator.AnimatorListener() {

        @Override
        public void onAnimationStart(Animator animation) {
        }

        @Override
        public void onAnimationRepeat(Animator animation) {
        }

        @Override
        public void onAnimationEnd(Animator animation) {
            messages.remove(actionBarItem);
            messages.remove(composingItem);
            actionBarItem = null;
            composingItem = null;
            messageEditText = null;
            messageCenterListAdapter.clearComposing();
            messageCenterListAdapter.notifyDataSetChanged();
            clearPendingComposingMessage();
            // Send out the new message. The delay is added to ensure the CardView showing animation
            // is visible after the keyboard is hidden
            if (!messageText.isEmpty() || imageAttachmentstList.size() != 0) {
                Bundle b = new Bundle();
                b.putString(COMPOSING_EDITTEXT_STATE, messageText);
                b.putParcelableArrayList(COMPOSING_ATTACHMENTS, messageAttachments);
                Message msg = messageCenterViewHandler.obtainMessage(MSG_START_SENDING, messageText);
                msg.setData(b);
                messageCenterViewHandler.sendMessageDelayed(msg, DEFAULT_DELAYMILLIS);
            }

            imageAttachmentstList.clear();
            showFab();
            showProfileButton();
        }

        @Override
        public void onAnimationCancel(Animator animation) {
        }
    }, null, DEFAULT_DELAYMILLIS);
}