Example usage for android.os Bundle putIntegerArrayList

List of usage examples for android.os Bundle putIntegerArrayList

Introduction

In this page you can find the example usage for android.os Bundle putIntegerArrayList.

Prototype

@Override
public void putIntegerArrayList(@Nullable String key, @Nullable ArrayList<Integer> value) 

Source Link

Document

Inserts an ArrayList value into the mapping of this Bundle, replacing any existing value for the given key.

Usage

From source file:net.xisberto.phonetodesktop.ui.LinkListActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putBoolean(Utils.EXTRA_UPDATING, swipeRefreshLayout.isRefreshing());
    outState.putParcelable(Utils.EXTRA_TITLES, taskList);
    ArrayList<Integer> selection = new ArrayList<>();
    for (int i = 0; i < selectedItems.size(); i++) {
        selection.add(selectedItems.keyAt(i));
    }//from   ww w.  j a va 2 s.c o  m
    Log.w("LinkList", String.format("Saving selection with %s items", selection.size()));
    outState.putIntegerArrayList(SELECTED_ITEMS, selection);
}

From source file:com.chute.android.photopickerplus.ui.activity.AssetActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putString(Constants.KEY_FOLDER_ID, folderId);
    List<Integer> accountPositions = new ArrayList<Integer>();
    List<Integer> imagePositions = new ArrayList<Integer>();
    List<Integer> videoPositions = new ArrayList<Integer>();
    if (listenerAccountsSelection != null && listenerAccountsSelection.getSocialPhotosSelection() != null) {
        accountPositions.addAll(listenerAccountsSelection.getSocialPhotosSelection());
        outState.putIntegerArrayList(Constants.KEY_SELECTED_ACCOUNTS_ITEMS,
                (ArrayList<Integer>) accountPositions);
    }//ww  w.ja v  a  2s  .c o  m
    if (listenerImagesSelection != null && listenerImagesSelection.getCursorImagesSelection() != null) {
        imagePositions.addAll(listenerImagesSelection.getCursorImagesSelection());
        outState.putIntegerArrayList(Constants.KEY_SELECTED_IMAGES_ITEMS, (ArrayList<Integer>) imagePositions);
    }
    if (listenerVideosSelection != null && listenerVideosSelection.getCursorVideosSelection() != null) {
        videoPositions.addAll(listenerVideosSelection.getCursorVideosSelection());
        outState.putIntegerArrayList(Constants.KEY_SELECTED_VIDEOS_ITEMS, (ArrayList<Integer>) videoPositions);
    }

}

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

@Override
public void onSaveInstanceState(Bundle outState, PersistableBundle outPersistentState) {
    ArrayList<Integer> pageHistoryList = new ArrayList<>();
    pageHistoryList.addAll(pageHistory);
    outState.putIntegerArrayList("pageHistory", pageHistoryList);
    super.onSaveInstanceState(outState, outPersistentState);
}

From source file:org.ale.scanner.zotero.MainActivity.java

@Override
public void onSaveInstanceState(Bundle state) {
    super.onSaveInstanceState(state);
    state.putStringArrayList(RC_PEND, mPendingItems);
    state.putIntegerArrayList(RC_PEND_STAT, mPendingStatus);
    state.putIntArray(RC_CHECKED, mItemAdapter.getChecked());
    state.putParcelable(RC_ACCESS, mAccountAccess);
    state.putInt(RC_UPLOADING, mUploadState);
    state.putSparseParcelableArray(RC_GROUPS, mGroups);
}

From source file:com.kaliturin.blacklist.fragments.AddOrEditContactFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    // save numbers and types to the lists
    ArrayList<String> numbers = new ArrayList<>();
    ArrayList<Integer> types = new ArrayList<>();
    Set<Pair<String, Integer>> numbers2TypeSet = getNumber2TypePairs();
    for (Pair<String, Integer> pair : numbers2TypeSet) {
        numbers.add(pair.first);//from  w  ww .  ja  v  a  2 s  .  c  om
        types.add(pair.second);
    }

    // save lists to state
    outState.putStringArrayList(CONTACT_NUMBERS, numbers);
    outState.putIntegerArrayList(CONTACT_NUMBER_TYPES, types);
}

From source file:com.example.linhdq.test.documents.viewing.grid.DocumentGridActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    Set<Integer> selection = mDocumentAdapter.getSelectedDocumentIds();
    ArrayList<Integer> save = new ArrayList<Integer>(selection.size());
    save.addAll(selection);//from  w  w  w  .  j  a  v  a  2s  .c om
    outState.putIntegerArrayList(SAVE_STATE_KEY, save);
}

From source file:org.proninyaroslav.libretorrent.fragments.DetailTorrentFilesFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    outState.putSerializable(TAG_FILE_TREE, fileTree);
    outState.putSerializable(TAG_CUR_DIR, curDir);
    if (layoutManager != null) {
        listFileState = layoutManager.onSaveInstanceState();
    }/*from  w  w  w .ja  v  a 2s. c  o m*/
    outState.putParcelable(TAG_LIST_FILE_STATE, listFileState);
    if (adapter != null) {
        outState.putIntegerArrayList(TAG_SELECTABLE_ADAPTER, adapter.getSelectedItems());
    }
    outState.putBoolean(TAG_IN_ACTION_MODE, inActionMode);
    outState.putStringArrayList(TAG_SELECTED_FILES, selectedFiles);

    super.onSaveInstanceState(outState);
}

From source file:mroza.forms.ChooseProgramActivity.java

protected void onSaveInstanceState(Bundle bundle) {
    super.onSaveInstanceState(bundle);

    //save filters
    if (selectedFilters.size() > 0) {
        ArrayList<Integer> filters = new ArrayList<>();
        for (MenuItem selectedFilter : selectedFilters) {
            filters.add(selectedFilter.getItemId());
        }/*w w w .  j a  v a  2  s .  co m*/
        bundle.putIntegerArrayList("FILTERS", filters);
    }

    //save letter filter
    if (letterFilter != null)
        bundle.putInt("LETTER_FILTER", letterFilter.getItemId());

    //save search query
    if (searchQuery != null)
        bundle.putString("SEARCH_FILTER", searchQuery);

    //save selected term
    Term term = getSelectedTerm();
    bundle.putInt("TERM", term.ordinal());
}

From source file:com.android.mail.ui.FolderListFragment.java

/**
 * Construct a bundle that represents the state of this fragment.
 *
 * @param parentFolder non-null for trees, the parent of this list
 * @param folderListUri the URI which contains all the list of folders
 * @param excludedFolderTypes if non-null, this indicates folders to exclude in lists.
 * @return Bundle containing parentFolder, divided list boolean and
 *         excluded folder types/* w  w  w. j a va  2s .com*/
 */
private static Bundle getBundleFromArgs(Folder parentFolder, Uri folderListUri,
        final ArrayList<Integer> excludedFolderTypes) {
    final Bundle args = new Bundle(3);
    if (parentFolder != null) {
        args.putParcelable(ARG_PARENT_FOLDER, parentFolder);
    }
    if (folderListUri != null) {
        args.putString(ARG_FOLDER_LIST_URI, folderListUri.toString());
    }
    if (excludedFolderTypes != null) {
        args.putIntegerArrayList(ARG_EXCLUDED_FOLDER_TYPES, excludedFolderTypes);
    }
    return args;
}

From source file:tv.acfun.video.HomeActivity.java

private Fragment getFragment(Category cat) {
    Fragment f = null;//from ww w. j a v  a2  s.c o m
    Bundle args = new Bundle();
    if (cat.subclasse != null && !cat.subclasse.isEmpty()) {
        /*
         * ?
         */
        f = new ChannelFragment();
        ArrayList<Integer> iDs = new ArrayList<Integer>(cat.subclasse.size());
        for (int i = 0; i < cat.subclasse.size(); i++) {
            int id = cat.subclasse.get(i).id;
            if (id != 71) // filter flash
                iDs.add(Integer.valueOf(id));
        }
        args.putIntegerArrayList(API.EXTRAS_CATEGORY_IDS, iDs);
        f.setArguments(args);
        f.setRetainInstance(true);

    } else {
        f = VideosFragment.newInstance(cat);
    }

    return f;
}