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:ca.mudar.mtlaucasou.BaseMapFragment.java

/**
 * Save map center and zoom. {@inheritDoc}
 *///  www. ja va 2 s  . c  o  m
@Override
public void onSaveInstanceState(Bundle outState) {
    GeoPoint center = mMapView.getMapCenter();
    int[] coords = { center.getLatitudeE6(), center.getLongitudeE6() };

    outState.putIntArray(Const.KEY_INSTANCE_COORDS, coords);
    outState.putInt(Const.KEY_INSTANCE_ZOOM, mMapView.getZoomLevel());

    super.onSaveInstanceState(outState);
}

From source file:com.billooms.harppedals.chords.ChordFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    //      Log.d(TAG, "ChordFragment.onSaveInstanceState");
    super.onSaveInstanceState(outState);
    if (outState == null) {
        return;//  w  ww .  j  av  a  2  s  .co  m
    }

    outState.putIntArray(ARG_CHORD, getChordArray());
    outState.putBooleanArray(ARG_CHORDADD, getChordAddArray());
    // must update any arguments sent to this fragment as well
    Bundle args = getArguments();
    if (args != null) {
        args.putIntArray(ARG_CHORD, getChordArray());
        args.putBooleanArray(ARG_CHORDADD, getChordAddArray());
    }
}

From source file:fm.feed.android.testapp.fragment.TestFragment.java

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

    outState.putIntArray(PLACEMENTS, mPlacements);
}

From source file:com.loloof64.android.chess_position_manager.MainActivity.java

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

    outState.putString(CURRENT_ABSOLUTE_PATH_TAG, directoryManager.getAbsolutePath());
    outState.putBoolean(SELECTION_MODE_TAG, selectionMode);
    outState.putIntArray(SELECTION_VALUES_TAG, listAdapter.getSelectedElementsPositions());
}

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

public Parcelable saveState() {
    Bundle state = null;

    saveCurrentFragmentState();/*from w w  w  .j a va2s . c  om*/
    if (mSavedState.size() > 0) {
        state = new Bundle();
        Fragment.SavedState[] fss = new Fragment.SavedState[mSavedState.size()];
        int[] keys = new int[mSavedState.size()];
        for (int i = 0; i < mSavedState.size(); i++) {
            int key = mSavedState.keyAt(i);
            keys[i] = key;
            fss[i] = mSavedState.get(key);
        }
        state.putParcelableArray("states", fss);
        state.putIntArray("state_keys", keys);
    }

    state.putInt("current_position", mCurrentPosition);

    return state;
}

From source file:us.parshall.ezandroid.activity.EZActivity.java

@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
    super.onSaveInstanceState(savedInstanceState);
    this.savePromptState();
    Log.i("EZActivity", String.format("promptDialogList size: %d", this.promptDialogList.size()));
    if (this.promptDialogList.size() > 0) {
        int[] tmpPromptDialogList = new int[this.promptDialogList.size()];
        for (int i = 0; i < this.promptDialogList.size(); i++) {
            tmpPromptDialogList[i] = this.promptDialogList.get(i);
        }/*  w  w w .j  av a2 s. c om*/
        savedInstanceState.putIntArray("promptDialogList", tmpPromptDialogList);
    }
}

From source file:com.github.michalbednarski.intentslab.valueeditors.framework.ChildFragmentWorkaround.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    int size = mDeliverInfos.size();
    int[] keys = new int[size];

    for (int i = 0; i < size; i++) {
        int key = mDeliverInfos.keyAt(i);
        DeliverResultInfo deliverInfo = mDeliverInfos.valueAt(i);

        keys[i] = key;//  w  ww .ja v  a  2 s  .co m
        outState.putInt(STATE_PREFIX_CODE + key, deliverInfo.requestCode);
        putChildFragmentInBundle(outState, STATE_PREFIX_FRAGMENT + key, deliverInfo.targetFragment);
    }

    outState.putIntArray(STATE_KEYS, keys);
    outState.putInt(STATE_NEXT_CODE, mNextNewResultCode);
}

From source file:com.hitkoDev.chemApp.fragment.SectionsFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState); //To change body of generated methods, choose Tools | Templates.
    int i = expanded.size();
    int[] k = new int[i];
    boolean[] v = new boolean[i];
    i = 0;/* w  w w.j  a v  a 2  s .  c  o  m*/
    for (Entry<Integer, Boolean> e : expanded.entrySet()) {
        k[i] = e.getKey();
        v[i] = e.getValue();
        i++;
    }
    outState.putIntArray(EXPANDED_KEYS, k);
    outState.putBooleanArray(EXPANDED_VALUES, v);
}

From source file:com.philliphsu.bottomsheetpickers.date.PagingMonthAdapter.java

@Override
public Parcelable saveState() {
    Bundle state = null;
    final int size = mMonthYearTitles.size();
    if (size > 0) {
        state = new Bundle();
        String[] titles = new String[size];
        int[] positions = new int[size];
        for (int i = 0; i < size; i++) {
            titles[i] = mMonthYearTitles.valueAt(i);
            positions[i] = mMonthYearTitles.keyAt(i);
        }/*from  w  ww  .j a v a2  s.  c o m*/
        state.putStringArray(KEY_MONTH_YEAR_TITLES, titles);
        state.putIntArray(KEY_POSITIONS, positions);
    }
    return state;
}

From source file:org.harleydroid.HarleyDroidService.java

public void startSend(String type[], String ta[], String sa[], String command[], String expect[], int timeout[],
        int delay) {
    if (D)//from  w ww .j a v  a2s.  com
        Log.d(TAG, "send()");
    Message m = mServiceHandler.obtainMessage(MSG_START_SEND);
    Bundle b = new Bundle();
    b.putStringArray("type", type);
    b.putStringArray("ta", ta);
    b.putStringArray("sa", sa);
    b.putStringArray("command", command);
    b.putStringArray("expect", expect);
    b.putIntArray("timeout", timeout);
    b.putInt("delay", delay);
    m.setData(b);
    //mServiceHandler.removeCallbacksAndMessages(null);
    m.sendToTarget();
}