Example usage for android.os Parcel writeInt

List of usage examples for android.os Parcel writeInt

Introduction

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

Prototype

public final void writeInt(int val) 

Source Link

Document

Write an integer value into the parcel at the current dataPosition(), growing dataCapacity() if needed.

Usage

From source file:com.codebutler.farebot.transit.orca.OrcaTransitData.java

@Override
public void writeToParcel(Parcel parcel, int flags) {
    parcel.writeInt(mSerialNumber);
    parcel.writeDouble(mBalance);/*www . j  a  va2  s . c o  m*/

    if (mTrips != null) {
        parcel.writeInt(mTrips.length);
        parcel.writeParcelableArray(mTrips, flags);
    } else {
        parcel.writeInt(0);
    }
}

From source file:pl.poznan.put.cs.ify.api.params.YParam.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(mType.ordinal());
    switch (mType) {
    case Boolean:
        dest.writeByte((byte) ((Boolean) mValue ? 0 : 1));
        break;// w  ww .j a v  a 2 s  .  c  om
    case Integer:
        dest.writeInt((Integer) mValue);
        break;
    case String:
        dest.writeString((String) mValue);
        break;
    case Group:
        dest.writeString((String) mValue);
        break;
    case Position:
        dest.writeParcelable((YPosition) mValue, 0);
    default:
        dest.writeString((String) mValue);
    }
}

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

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(this.id);
    dest.writeInt(this.owner_id);
    dest.writeString(this.title);
    dest.writeLong(this.size);
    dest.writeString(this.ext);
    dest.writeString(this.url);
    dest.writeString(this.photo_100);
    dest.writeString(this.photo_130);
    dest.writeParcelable(this.photo, flags);
    dest.writeString(this.access_key);
    dest.writeByte(mIsImage ? (byte) 1 : (byte) 0);
    dest.writeByte(mIsGif ? (byte) 1 : (byte) 0);
}

From source file:com.jetradar.multibackstack.BackStackEntry.java

@Override
public void writeToParcel(Parcel out, int flags) {
    out.writeString(fname);/*from ww w  . j  a v a2  s .  c o  m*/
    out.writeBundle(args);

    if (state == null) {
        out.writeInt(NO_STATE);
    } else if (state.getClass() == SavedState.class) {
        out.writeInt(SAVED_STATE);
        state.writeToParcel(out, flags);
    } else {
        out.writeInt(PARCELABLE_STATE);
        out.writeParcelable(state, flags);
    }
}

From source file:com.richtodd.android.quiltdesign.block.Theme.java

@Override
public void writeToParcel(Parcel out, int flags) {
    out.writeInt(m_swatches.size());
    for (Swatch swatch : m_swatches) {
        out.writeInt(swatch.getColor());
    }//from  w  w w. j  a v  a  2 s . c  om
}

From source file:edu.pdx.its.portal.routelandia.entities.TrafficStat.java

/**
 * Flatten this object in to a Parcel./*from w w w  . j  a v a 2s . c  o m*/
 *
 * @param dest  The Parcel in which the object should be written.
 * @param flags Additional flags about how the object should be written.
 *              May be 0 or {@link #PARCELABLE_WRITE_RETURN_VALUE}.
 */
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(hour);
    dest.writeInt(minutes);
    dest.writeDouble(speed);
    dest.writeDouble(travelTime);
    dest.writeDouble(accuracy);
    dest.writeDouble(distance);
}

From source file:br.ufrj.ppgi.jemf.mobile.bean.Commander.java

/**
 * Write Commander data to Parcelable. //www.  j  a v a  2  s.  co  m
 */
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(getId());
    dest.writeString(getName());
    dest.writeInt(getGender());
    dest.writeString(getBirthDateString());
    dest.writeInt(getAge());
    dest.writeString(getLogin());
    dest.writeString(getPassword());
}

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

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(this.id);
    dest.writeInt(this.owner_id);
    dest.writeString(this.artist);
    dest.writeString(this.title);
    dest.writeInt(this.duration);
    dest.writeString(this.url);
    dest.writeInt(this.lyrics_id);
    dest.writeInt(this.album_id);
    dest.writeInt(this.genre);
    dest.writeString(this.access_key);
}

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

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(this.id);
    dest.writeInt(this.group_id);
    dest.writeInt(this.creator_id);
    dest.writeString(this.title);
    dest.writeString(this.source);
    dest.writeByte(current_user_can_edit ? (byte) 1 : (byte) 0);
    dest.writeByte(current_user_can_edit_access ? (byte) 1 : (byte) 0);
    dest.writeInt(this.who_can_view);
    dest.writeInt(this.who_can_edit);
    dest.writeInt(this.editor_id);
    dest.writeLong(this.edited);
    dest.writeLong(this.created);
    dest.writeString(this.parent);
    dest.writeString(this.parent2);
}

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

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(this.id);
    dest.writeInt(this.owner_id);
    dest.writeLong(this.created);
    dest.writeString(this.question);
    dest.writeInt(this.votes);
    dest.writeInt(this.answer_id);
    dest.writeParcelable(this.answers, flags);
}