Example usage for android.os Parcel readInt

List of usage examples for android.os Parcel readInt

Introduction

In this page you can find the example usage for android.os Parcel readInt.

Prototype

public final int readInt() 

Source Link

Document

Read an integer value from the parcel at the current dataPosition().

Usage

From source file:com.harlie.android.sunshine.app.ItemChoiceManager.java

public void onRestoreInstanceState(Bundle savedInstanceState) {
    byte[] states = savedInstanceState.getByteArray(SELECTED_ITEMS_KEY);
    if (null != states) {
        Parcel inParcel = Parcel.obtain();
        inParcel.unmarshall(states, 0, states.length);
        inParcel.setDataPosition(0);//from  ww  w  . j a va 2s.c  o  m
        mCheckStates = inParcel.readSparseBooleanArray();
        final int numStates = inParcel.readInt();
        mCheckedIdStates.clear();
        for (int i = 0; i < numStates; i++) {
            final long key = inParcel.readLong();
            final int value = inParcel.readInt();
            mCheckedIdStates.put(key, value);
        }
        inParcel.recycle();
    }
}

From source file:com.nextgis.firereporter.ScanexSubscriptionItem.java

private ScanexSubscriptionItem(Parcel in) {
    nID = in.readLong();//w  w  w.  j a v  a  2s.  c o m
    sTitle = in.readString();
    sLayerName = in.readString();
    sWKT = in.readString();
    bSMSEnable = in.readInt() == 1 ? true : false;
    bHasNews = in.readInt() == 1 ? true : false;

    mmoItems = new HashMap<Long, ScanexNotificationItem>();
    int nSize = in.readInt();
    for (int i = 0; i < nSize; i++) {
        ScanexNotificationItem it = (ScanexNotificationItem) in
                .readValue(ScanexNotificationItem.class.getClassLoader());
        mmoItems.put(it.GetId(), it);
    }
}

From source file:app.com.example.android.sunshine.ItemChoiceManager.java

public void onRestoreInstanceState(Bundle savedInstanceState) {
    byte[] states = savedInstanceState.getByteArray(SELECTED_ITEMS_KEY);
    if (null != states) {
        Parcel inParcel = Parcel.obtain();
        inParcel.unmarshall(states, 0, states.length);
        inParcel.setDataPosition(0);/* ww  w . j a v a 2s  .c  o m*/
        mCheckStates = inParcel.readSparseBooleanArray();
        final int numStates = inParcel.readInt();
        mCheckedIdStates.clear();
        for (int i = 0; i < numStates; i++) {
            final long key = inParcel.readLong();
            final int value = inParcel.readInt();
            mCheckedIdStates.put(key, value);
        }
    }
}

From source file:saphion.batterycaster.providers.Alarm.java

Alarm(Parcel p) {
    id = p.readLong();/*from   ww w. j  a  v  a  2  s  .com*/
    enabled = p.readInt() == 1;
    battery = p.readInt();
    charge = p.readInt();
    daysOfWeek = new DaysOfWeek(p.readInt());
    vibrate = p.readInt() == 1;
    label = p.readString();
    alert = (Uri) p.readParcelable(null);
    deleteAfterUse = p.readInt() == 1;
}

From source file:com.baasbox.android.BaasUser.java

private static void readStringSet(Parcel p, Set<String> set) {
    int size = p.readInt();
    String[] arr = new String[size];
    p.readStringArray(arr);/*from  ww  w  . ja  v  a  2s .com*/
    Collections.addAll(set, arr);
}

From source file:org.onepf.opfmaps.osmdroid.model.BitmapDescriptor.java

private BitmapDescriptor(@NonNull final Parcel parcel) {
    this.source = BitmapSource.valueOf(parcel.readString());
    this.image = parcel.readParcelable(Bitmap.class.getClassLoader());
    this.path = parcel.readString();
    this.hue = parcel.readFloat();
    this.resourceId = parcel.readInt();
}

From source file:org.mozilla.mozstumbler.service.scanners.cellscanner.CellInfo.java

private CellInfo(Parcel in) {
    mRadio = in.readString();/*ww w  .ja va2s.  c  o  m*/
    mCellRadio = in.readString();
    mMcc = in.readInt();
    mMnc = in.readInt();
    mCid = in.readInt();
    mLac = in.readInt();
    mSignal = in.readInt();
    mAsu = in.readInt();
    mTa = in.readInt();
    mPsc = in.readInt();
}

From source file:com.eTilbudsavis.etasdk.model.User.java

private User(Parcel in) {
    this.mErn = in.readString();
    this.mGender = in.readString();
    this.mBirthYear = in.readInt();
    this.mName = in.readString();
    this.mEmail = in.readString();
    this.mPermissions = in.readParcelable(Permission.class.getClassLoader());
}

From source file:com.vk.sdk.api.model.VKList.java

/**
 * Creates list from Parcel/*from  w w  w . ja  v  a  2  s. co m*/
 */
public VKList(Parcel in) {
    int size = in.readInt();
    for (int i = 0; i < size; i++) {
        items.add(((T) in.readParcelable(((Object) this).getClass().getClassLoader())));
    }
    this.count = in.readInt();
}

From source file:com.rubengees.introduction.entity.Slide.java

protected Slide(Parcel in) {
    this.position = in.readInt();
    this.title = in.readString();
    this.titleResource = (Integer) in.readValue(Integer.class.getClassLoader());
    this.titleSize = (Float) in.readValue(Float.class.getClassLoader());
    this.description = in.readString();
    this.descriptionResource = (Integer) in.readValue(Integer.class.getClassLoader());
    this.descriptionSize = (Float) in.readValue(Float.class.getClassLoader());
    this.imageResource = (Integer) in.readValue(Integer.class.getClassLoader());
    this.color = (Integer) in.readValue(Integer.class.getClassLoader());
    this.colorResource = (Integer) in.readValue(Integer.class.getClassLoader());
    this.option = in.readParcelable(Option.class.getClassLoader());
    this.customViewBuilder = (CustomViewBuilder) in.readSerializable();
}