Example usage for android.os Bundle putIntArray

List of usage examples for android.os Bundle putIntArray

Introduction

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

Prototype

public void putIntArray(@Nullable String key, @Nullable int[] value) 

Source Link

Document

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

Usage

From source file:com.actinarium.kinetic.ui.MainActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putParcelable(ARG_ACCEL, mAccelData);
    outState.putParcelable(ARG_GYRO, mGyroData);
    outState.putParcelable(ARG_RV, mRotVectorData);
    outState.putBooleanArray(ARG_RHS, mResultHoldersState);
    outState.putIntArray(ARG_HAM, mHolderToAnimatorMap);
}

From source file:org.akop.crosswords.fragment.BaseFragment.java

protected void putSparseBooleanArray(Bundle bundle, String prefix, SparseBooleanArray array) {
    int size = array.size();
    int keys[] = new int[size];
    boolean values[] = new boolean[size];

    for (int i = 0; i < size; i++) {
        keys[i] = array.keyAt(i);//from  w w w.j av a  2  s  .  co  m
        values[i] = array.valueAt(i);
    }

    bundle.putIntArray(prefix + "_keys", keys);
    bundle.putBooleanArray(prefix + "_values", values);
}

From source file:io.github.hidroh.materialistic.ItemFragment.java

private void showPreferences() {
    Bundle args = new Bundle();
    args.putInt(PopupSettingsFragment.EXTRA_TITLE, R.string.font_options);
    args.putInt(PopupSettingsFragment.EXTRA_SUMMARY, R.string.pull_up_hint);
    args.putIntArray(PopupSettingsFragment.EXTRA_XML_PREFERENCES,
            new int[] { R.xml.preferences_font, R.xml.preferences_comments });
    ((DialogFragment) Fragment.instantiate(getActivity(), PopupSettingsFragment.class.getName(), args))
            .show(getFragmentManager(), PopupSettingsFragment.class.getName());
}

From source file:org.ale.scanner.zotero.web.zotero.ZoteroAPIClient.java

public void addItems(JSONObject items, int[] rows, int userOrGroupId)
        throws UnsupportedEncodingException, IllegalArgumentException {
    // POST https://apis.zotero.org/users/<userid>/items

    if (rows.length > ZoteroAPIClient.MAX_UPLOAD_CNT) {
        throw new IllegalArgumentException("Maximum upload size exceeded");
    }/*from www.  java2 s.c om*/

    APIRequest r = newRequest();
    r.setHttpMethod(APIRequest.POST);

    HashMap<String, String> queryTerms = new HashMap<String, String>();
    queryTerms.put("content", "json");
    queryTerms.put("key", mAccount.getKey());
    r.setURI(buildURI(queryTerms, String.valueOf(userOrGroupId), "items"));

    r.setContent(items.toString(), "application/json");
    r.addHeader(HDR_WRITE_TOKEN, newWriteToken());

    Bundle extra = new Bundle();
    extra.putIntArray(EXTRA_ITEM_IDS, rows);
    extra.putInt(EXTRA_REQ_TYPE, ZoteroAPIClient.ITEMS);
    r.setExtra(extra);

    mRequestQueue.enqueue(r);
}

From source file:androidx.navigation.fragment.FragmentNavigator.java

@Override
@Nullable// w w  w. j a va  2 s .  co m
public Bundle onSaveState() {
    Bundle b = new Bundle();
    int[] backStack = new int[mBackStack.size()];
    int index = 0;
    for (Integer id : mBackStack) {
        backStack[index++] = id;
    }
    b.putIntArray(KEY_BACK_STACK_IDS, backStack);
    return b;
}

From source file:de.aw.monma.mainscreen.FragmentFinanzen.java

@Override
protected void setInternalArguments(Bundle args) {
    super.setInternalArguments(args);
    args.putParcelable(DBDEFINITION, tbd);
    args.putInt(LAYOUT, layout);/*  w  w  w .j  av a 2 s.c o  m*/
    args.putInt(VIEWHOLDERLAYOUT, viewHolderLayout);
    args.putStringArray(PROJECTION, projection);
    args.putString(ORDERBY, orderBy);
    args.putIntArray(VIEWRESIDS, viewResIDs);
    zeigeAusgeblendeteKonten = prefs.getBoolean(getString(R.string.menu_item_hideAccounts), false);
    if (!zeigeAusgeblendeteKonten) {
        String selection = " NOT " + column_ausgeblendet;
        args.putString(SELECTION, selection);
    }
}

From source file:com.tatteam.patente.ui.fragment.DoExamsFragment.java

private void switchToCorreggiFragment() {
    if (exitDialog != null && exitDialog.isShowing()) {
        exitDialog.dismiss();//from   w ww.  j  a  v  a2 s  . c  o m
    }
    if (finishDialog != null && finishDialog.isShowing()) {
        finishDialog.dismiss();
    }

    int[] answers = new int[listExams.size()];
    for (int i = 0; i < answers.length; i++) {
        answers[i] = listExams.get(i).myAnswer;
    }

    final CorreggiFragment fragment = new CorreggiFragment();
    Bundle dataBundle = new Bundle();
    dataBundle.putIntArray(BUNDLE_ANSWER, answers);
    dataBundle.putInt(BUNDLE_CATEGORY_ID, menuId);
    dataBundle.putInt(BUNDLE_SHEET_NO, sheetNo);
    dataBundle.putInt(BUNDLE_TIME, examTotalDuration - countDown);
    fragment.setArguments(dataBundle);
    replaceFragment(fragment, true);
}

From source file:nz.ac.otago.psyanlab.common.designer.program.ProgramFragment.java

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

    // Build and store an array of our internal ids so we can reconstruct
    // our fragment tags.
    int[] ids = new int[mFragments.size()];
    for (int i = 0; i < ids.length; i++) {
        ids[i] = mFragments.get(i).getScrollerPos();
    }/*  ww  w.ja va  2 s  .  co  m*/

    outState.putIntArray(KEY_FRAG_IDS, ids);

    outState.putInt(KEY_SCROLL_POSITION, mScroller.getScrollX());
}

From source file:com.billooms.harppedals.HarpPedalsActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    //      Log.d(TAG, "HarpPedalsActivity.onSaveInstanceState");
    super.onSaveInstanceState(outState);

    if (outState == null) {
        return;/*from   w  w  w .  j  a  v a  2s .c o  m*/
    }
    if (savedChordArray != null) {
        outState.putIntArray(ARG_CHORD, savedChordArray);
    }
    if (savedChordAddArray != null) {
        outState.putBooleanArray(ARG_CHORDADD, savedChordAddArray);
    }
    if (savedKey != null) {
        outState.putInt(ARG_KEY, savedKey.getKeySignature().ordinal());
        outState.putInt(ARG_SCALE, savedKey.getScale().ordinal());
    }
}

From source file:io.github.hidroh.materialistic.BaseWebFragment.java

private void showPreferences() {
    Bundle args = new Bundle();
    args.putInt(PopupSettingsFragment.EXTRA_TITLE, R.string.font_options);
    args.putIntArray(PopupSettingsFragment.EXTRA_XML_PREFERENCES, new int[] { R.xml.preferences_readability });
    ((DialogFragment) Fragment.instantiate(getActivity(), PopupSettingsFragment.class.getName(), args))
            .show(getFragmentManager(), PopupSettingsFragment.class.getName());
}