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.wellsandwhistles.android.redditsp.reddit.things.RedditComment.java

public void writeToParcel(final Parcel parcel, final int flags) {

    parcel.writeString(body);//from   www. ja  va 2 s  . c o m
    parcel.writeString(body_html);
    parcel.writeString(author);
    parcel.writeString(subreddit);
    parcel.writeString(author_flair_text);
    parcel.writeInt(archived ? 1 : 0);

    if (likes == null) {
        parcel.writeInt(0);
    } else {
        parcel.writeInt(likes ? 1 : -1);
    }

    parcel.writeString(id);
    parcel.writeString(subreddit_id);
    parcel.writeString(link_id);
    parcel.writeString(parent_id);
    parcel.writeString(name);
    parcel.writeString(context);

    parcel.writeInt(ups);
    parcel.writeInt(downs);

    if (edited instanceof Long) {
        parcel.writeLong((Long) edited);
    } else {
        parcel.writeLong(-1);
    }

    parcel.writeLong(created);
    parcel.writeLong(created_utc);

    parcel.writeInt(saved ? 1 : 0);
    parcel.writeInt(gilded);

    parcel.writeString(distinguished);
}

From source file:com.oasisfeng.nevo.StatusBarNotificationEvo.java

/** Write all fields except the Notification which is passed as IPC holder */
@Override/*from   w  ww.ja  v  a  2  s . c  om*/
public void writeToParcel(final Parcel out, final int flags) {
    if ((flags & FLAG_WRITE_AS_ORIGINAL) != 0) {
        super.writeToParcel(out, flags & ~FLAG_WRITE_AS_ORIGINAL);
        return;
    }
    out.writeInt(PARCEL_MAGIC);
    out.writeString(getPackageName());
    out.writeInt(getId());
    if (getTag() != null) {
        out.writeInt(1);
        out.writeString(getTag());
    } else
        out.writeInt(0);
    out.writeInt(getUid(this));
    getUser().writeToParcel(out, flags);
    out.writeLong(getPostTime());
    out.writeStrongInterface(notification == null ? holder : new NotificationHolder(notification)); // The local copy of notification is "dirty" (possibly modified), hence needs to be updated.
}

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

private static void writeStringSet(Parcel p, Set<String> s) {
    p.writeInt(s.size());
    p.writeStringArray(s.toArray(new String[s.size()]));
}

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

public void writeToParcel(Parcel out, int flags) {
    out.writeLong(nID);/*from  w w  w.j  a  v a 2s . com*/
    out.writeString(sTitle);
    out.writeString(sLayerName);
    out.writeString(sWKT);
    out.writeInt(bSMSEnable == true ? 1 : 0);
    out.writeInt(bHasNews == true ? 1 : 0);
    //
    out.writeInt(mmoItems.size());
    for (ScanexNotificationItem it : mmoItems.values()) {
        out.writeValue(it);
    }
}

From source file:net.issarlk.androbunny.inkbunny.Submission.java

public void writeToParcel(Parcel out, int flag) {
    out.writeLong(Submission.serialVersionUID);
    out.writeInt(this.id);
    out.writeInt(this.hidden);
    this.user.writeToParcel(out, 0);
    out.writeString(this.create_datetime);
    out.writeString(this.create_datetime_usertime);
    out.writeString(this.file_name);
    out.writeInt(this.thumbnails.length);
    for (int i = this.thumbnails.length - 1; i >= 0; i--) {
        if (this.thumbnails[i] != null) {
            out.writeInt(1);//  w  w  w  .j  av a 2  s .  c om
            this.thumbnails[i].writeToParcel(out, 0);
        } else {
            out.writeInt(0);
        }
    }
    out.writeString(this.title);
    out.writeInt(this.deleted);
    out.writeInt(this.s_public);
    out.writeString(this.mimetype);
    this.rating.writeToParcel(out, 0);
    this.submission_type.writeToParcel(out, 0);
    out.writeInt(this.digitalsales);
    out.writeInt(this.printsales);
    out.writeInt(this.guest_block);

    // Full info
    if (this.keywords != null) {
        out.writeInt(1);
        out.writeInt(this.keywords.length);
        for (int i = this.keywords.length - 1; i >= 0; i--) {
            this.keywords[i].writeToParcel(out, 0);
        }
        out.writeInt(this.scraps);
        out.writeInt(this.favorite);
        out.writeInt(this.favorites_count);
        out.writeInt(this.comments_count);
        out.writeInt(this.files.length);
        for (int i = this.files.length - 1; i >= 0; i--) {
            this.files[i].writeToParcel(out, 0);
        }
        out.writeString(this.file_urls[FULL].toString());
        out.writeString(this.file_urls[SCREEN].toString());
        out.writeString(this.file_urls[PREVIEW].toString());
    } else {
        out.writeInt(0);
    }

    //Description      
    if (this.description != null) {
        out.writeInt(1);
        out.writeString(this.description);
    } else {
        out.writeInt(0);
    }

    //Writing
    if (this.writing != null) {
        out.writeInt(1);
        out.writeString(this.writing);
    } else {
        out.writeInt(0);
    }
}

From source file:vandy.mooc.model.provider.VideoClient.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeLong(id);/*from  w  ww .  ja v a  2  s.  c o  m*/
    dest.writeString(title);
    dest.writeLong(duration);
    dest.writeString(location);
    dest.writeString(subject);
    dest.writeString(contentType);
    dest.writeDouble(rating);
    dest.writeInt(count);
    dest.writeString(filepath);

}

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

public void writeToParcel(Parcel p, int flags) {
    p.writeLong(id);/*from   w ww .  ja va  2  s.  c o  m*/
    p.writeInt(enabled ? 1 : 0);
    p.writeInt(battery);
    p.writeInt(charge);
    p.writeInt(daysOfWeek.getBitSet());
    p.writeInt(vibrate ? 1 : 0);
    p.writeString(label);
    p.writeParcelable(alert, flags);
    p.writeInt(deleteAfterUse ? 1 : 0);
}

From source file:com.codebutler.farebot.card.felica.FelicaCard.java

@Override
public void writeToParcel(Parcel parcel, int flags) {
    super.writeToParcel(parcel, flags);
    parcel.writeParcelable(mIDm, flags);
    parcel.writeParcelable(mPMm, flags);
    parcel.writeInt(mSystems.length);
    parcel.writeTypedArray(mSystems, flags);
}

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

public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(this.mErn);
    dest.writeString(this.mGender);
    dest.writeInt(this.mBirthYear);
    dest.writeString(this.mName);
    dest.writeString(this.mEmail);
    dest.writeParcelable(this.mPermissions, flags);
}

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

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(mRadio);/* www .  java 2 s  .  c  o m*/
    dest.writeString(mCellRadio);
    dest.writeInt(mMcc);
    dest.writeInt(mMnc);
    dest.writeInt(mCid);
    dest.writeInt(mLac);
    dest.writeInt(mSignal);
    dest.writeInt(mAsu);
    dest.writeInt(mTa);
    dest.writeInt(mPsc);
}