Android实现Parcelable 直接intent传参
作者:互联网
protected DBean(Parcel in) {
id = in.readString();
cid = in.readString();
name = in.readString();
status = in.readString();
url = in.readString();
money = in.readString();
}
public static final Creator<DBean> CREATOR = new Creator<DBean>() {
@Override
public DBean createFromParcel(Parcel in) {
return new DBean(in);
}
@Override
public DBean[] newArray(int size) {
return new DBean[size];
}
};
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(id);
dest.writeString(cid);
dest.writeString(name);
dest.writeString(status);
dest.writeString(url);
dest.writeString(money);
}
标签:传参,writeString,dest,Parcelable,DBean,public,intent,Override,readString 来源: https://blog.csdn.net/u010838785/article/details/90069512