List of usage examples for android.os Parcel writeSparseBooleanArray
public final void writeSparseBooleanArray(SparseBooleanArray val)
From source file:app.com.example.android.sunshine.ItemChoiceManager.java
public void onSaveInstanceState(Bundle outState) { Parcel outParcel = Parcel.obtain(); outParcel.writeSparseBooleanArray(mCheckStates); final int numStates = mCheckedIdStates.size(); outParcel.writeInt(numStates);/*from w ww. j av a 2s. com*/ for (int i = 0; i < numStates; i++) { outParcel.writeLong(mCheckedIdStates.keyAt(i)); outParcel.writeInt(mCheckedIdStates.valueAt(i)); } byte[] states = outParcel.marshall(); outState.putByteArray(SELECTED_ITEMS_KEY, states); outParcel.recycle(); }