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.sufficientlysecure.keychain.ui.EncryptFileActivity.java

private Bundle createEncryptBundle() {
    // fill values for this action
    Bundle data = new Bundle();

    data.putInt(KeychainIntentService.SOURCE, KeychainIntentService.IO_URIS);
    data.putParcelableArrayList(KeychainIntentService.ENCRYPT_INPUT_URIS, mInputUris);

    data.putInt(KeychainIntentService.TARGET, KeychainIntentService.IO_URIS);
    data.putParcelableArrayList(KeychainIntentService.ENCRYPT_OUTPUT_URIS, mOutputUris);

    data.putInt(KeychainIntentService.ENCRYPT_COMPRESSION_ID,
            Preferences.getPreferences(this).getDefaultFileCompression());

    // Always use armor for messages
    data.putBoolean(KeychainIntentService.ENCRYPT_USE_ASCII_ARMOR, mUseArmor);

    if (isModeSymmetric()) {
        Log.d(Constants.TAG, "Symmetric encryption enabled!");
        String passphrase = mPassphrase;
        if (passphrase.length() == 0) {
            passphrase = null;/* w  w  w .j  a  v a  2  s.c  om*/
        }
        data.putString(KeychainIntentService.ENCRYPT_SYMMETRIC_PASSPHRASE, passphrase);
    } else {
        data.putLong(KeychainIntentService.ENCRYPT_SIGNATURE_MASTER_ID, mSigningKeyId);
        data.putLongArray(KeychainIntentService.ENCRYPT_ENCRYPTION_KEYS_IDS, mEncryptionKeyIds);
    }
    return data;
}

From source file:com.gbozza.android.popularmovies.fragments.MovieDetailFragment.java

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

    List<Video> videosList = mVideosAdapter.getVideosData();
    if (null != videosList) {
        ArrayList<Video> videoArrayList = new ArrayList<>(videosList);
        outState.putParcelableArrayList(BUNDLE_VIDEOS_KEY, videoArrayList);
    }/*from  w ww  .j a  v  a 2s. c o  m*/

    List<Review> reviewsList = mReviewsAdapter.getReviewsData();
    if (null != reviewsList) {
        ArrayList<Review> reviewArrayList = new ArrayList<>(reviewsList);
        outState.putParcelableArrayList(BUNDLE_REVIEWS_KEY, reviewArrayList);
    }
}

From source file:edgargtzg.popularmovies.MovieDetailsFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putParcelableArrayList(VIDEO_LIST_KEY, mListOfVideos);
    outState.putParcelableArrayList(REVIEW_LIST_KEY, mListOfReviews);
}

From source file:io.github.hidroh.materialistic.widget.StoryRecyclerViewAdapter.java

@Override
public Bundle saveState() {
    Bundle savedState = super.saveState();
    savedState.putParcelableArrayList(STATE_ITEMS, mItems);
    savedState.putParcelableArrayList(STATE_UPDATED, mUpdated);
    ArrayList<String> promotedKey = new ArrayList<>(mPromoted.size());
    ArrayList<Integer> promotedValue = new ArrayList<>(mPromoted.size());
    for (Map.Entry<String, Integer> entry : mPromoted.entrySet()) {
        promotedKey.add(entry.getKey());
        promotedValue.add(entry.getValue());
    }/*from   w w  w. j a  v a 2 s.c o m*/
    savedState.putStringArrayList(STATE_PROMOTED_KEY, promotedKey);
    savedState.putIntegerArrayList(STATE_PROMOTED_VALUE, promotedValue);
    savedState.putBoolean(STATE_SHOW_ALL, mShowAll);
    savedState.putBoolean(STATE_HIGHLIGHT_UPDATED, mHighlightUpdated);
    savedState.putInt(STATE_FAVORITE_REVISION, mFavoriteRevision);
    savedState.putString(STATE_USERNAME, mUsername);
    return savedState;
}

From source file:org.gdg.frisbee.android.chapter.MainActivity.java

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

    if (mChapterAdapter.getCount() > 0) {
        outState.putParcelableArrayList(ARG_CHAPTERS, mChapterAdapter.getAll());
    }//from  w w  w .j a va  2  s  .  c o m
    if (mViewPagerAdapter != null) {
        outState.putString(ARG_SELECTED_CHAPTER, mViewPagerAdapter.getSelectedChapter());
    }
}

From source file:com.andrew67.ddrfinder.activity.MapViewer.java

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

    // Save the list of currently loaded map areas and locations
    outState.putParcelableArrayList("loadedAreas", loadedAreas);
    final ArrayList<ArcadeLocation> loadedLocations = new ArrayList<>(currentMarkers.size());
    loadedLocations.addAll(currentMarkers.values());
    outState.putParcelableArrayList("loadedLocations", loadedLocations);

    // Save the map of currently loaded sources, as a list
    final ArrayList<DataSource> currSources = new ArrayList<>(loadedSources.size());
    currSources.addAll(loadedSources.values());
    outState.putParcelableArrayList("loadedSources", currSources);
}

From source file:com.zns.comicdroid.activity.Comics.java

@Override
protected void onSaveInstanceState(Bundle state) {
    super.onSaveInstanceState(state);
    if (mAmazonAdapter != null) {
        List<Book> books = mAmazonAdapter.getAllChildren(0);
        if (books != null) {
            state.putParcelableArrayList(STATE_BOOKS, new ArrayList<Book>(books));
        }//www  .  jav  a2s .c  o m
    }
}

From source file:com.veniosg.dir.android.fragment.FileListFragment.java

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

    outState.putString(INSTANCE_STATE_PATH, mPath);
    outState.putInt(INSTANCE_STATE_NEEDS_LOADING, isScannerRunning() ? 1 : 0);
    outState.putParcelableArrayList(INSTANCE_STATE_FILES, mFiles);
}

From source file:net.lp.actionbarpoirot.tasks.TaskManager.java

/**
 * Save the per-instance state of the activity, and perform the work related to tasks.
 * //from   w  ww .j a  va2s  .c  o  m
 * @param outState
 */
public void saveInstanceState(Bundle outState) {
    ArrayList<Parcelable> outTaskList = new ArrayList<Parcelable>();
    for (VisibleTask<?, ?, ?, ?, ?> task : tasks) {
        Bundle bundle = new Bundle();
        if (task.saveTask(bundle)) {
            bundle.putString(KEY_TASK_CLASS, task.getClass().getName());
            outTaskList.add(bundle);
        }
    }
    outState.putParcelableArrayList(KEY_TASK_LIST, outTaskList);
    tasks = new ArrayList<VisibleTask<?, ?, ?, ?, ?>>();
}

From source file:com.simas.vc.MainActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putParcelableArrayList(STATE_ITEMS, sItems);
}