在android中创建包含对象数组对象List 的Parcelable

public class Bill implements Parcelable {
	public int staff;
	public int type;
	public Goods goods[];
	public List arrgoods;

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeInt(staff);
		dest.writeInt(type);
		dest.writeParcelableArray(goods, flags);
	}

	@SuppressWarnings("unused")
	public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
		@Override
		public Bill createFromParcel(Parcel in) {
			return new Bill(in);
		}

		@Override
		public Bill[] newArray(int size) {
			return new Bill[size];
		}
	};
}


 
 

你可能感兴趣的:(android)