Example usage for android.os Parcel writeValue

List of usage examples for android.os Parcel writeValue

Introduction

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

Prototype

public final void writeValue(Object v) 

Source Link

Document

Flatten a generic object in to a parcel.

Usage

From source file:Main.java

public static byte[] marshall(Object value) {
    if (value == null) {
        return null;
    }/* w w  w . j  ava  2 s .c  o m*/

    Parcel parcel = Parcel.obtain();
    try {
        parcel.writeValue(value);
        return parcel.marshall();
    } finally {
        parcel.recycle();
    }
}

From source file:edu.umich.flowfence.common.ParceledPayload.java

public static boolean canParcelObject(Object obj) {
    Parcel p = Parcel.obtain();
    try {/*from w ww.j  a va 2s. c  o m*/
        p.writeValue(obj);
        return true;
    } catch (Exception e) {
        return false;
    } finally {
        p.recycle();
    }
}

From source file:edu.umich.flowfence.common.ParceledPayload.java

public static ParceledPayload create(Object object) {
    Parcel p = Parcel.obtain();
    boolean oldFds = p.pushAllowFds(false);
    try {/*from   ww  w .  j  a  v a2  s .co  m*/
        p.writeValue(object);
        return new ParceledPayload(p.marshall());
    } finally {
        p.restoreAllowFds(oldFds);
        p.recycle();
    }
}

From source file:com.github.jobs.bean.AboutMeService.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeValue(displayName);
    dest.writeValue(platform);//from   w ww  .  j av  a2s.c om
    dest.writeValue(serviceUrl);
}

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

/**
 * Write Team data to Parcelable. /*from  w w w.  j av  a  2 s  .com*/
 */
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeValue(getLeader());
    dest.writeList(getMembers());
    dest.writeInt(getId());
    dest.writeString(getName());
}

From source file:com.github.jobs.bean.AboutMeUser.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeValue(firstName);
    dest.writeValue(lastName);/*from ww  w. j a va2  s .co  m*/
    dest.writeValue(header);
    dest.writeValue(profile);
    dest.writeValue(bio);
    dest.writeParcelableArray(services, flags);
}

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

public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(this.mLogo);
    dest.writeValue(this.mColor);
}

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

public void writeToParcel(Parcel dest, int flags) {
    dest.writeDouble(this.mPrice);
    dest.writeValue(this.mPrePrice);
    dest.writeString(this.mCurrency);
}

From source file:com.github.jobs.bean.SOUser.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeValue(id);
    dest.writeValue(displayName);/*from w  w  w  .j  a v  a  2s.c  om*/
    dest.writeValue(profileImage);
    dest.writeValue(reputation);
    dest.writeValue(link);
    dest.writeValue(websiteUrl);
    dest.writeValue(accountId);
    dest.writeValue(badgeCount);
}

From source file:com.github.jobs.bean.Job.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeValue(id);
    dest.writeValue(title);/*  w  w w.j a va2  s  . c  om*/
    dest.writeValue(companyLogo);
    dest.writeValue(location);
    dest.writeValue(description);
    dest.writeValue(company);
    dest.writeValue(howToApply);
    dest.writeValue(createdAt);
    dest.writeValue(type);
    dest.writeValue(url);
    dest.writeValue(companyUrl);
}