Reputation: 43
I'm attempting to implement parcelable for the a class with following fields. Im getting an exception when attempting to create the class from the parcel (put in a bundle) on the fields String mStyle[] and byte[] mImage .I'm not receiving any errors on these fields on writeToParcel-- what is the correct usage?. thanks much
private String mClothingItemName;
private String mColor;
private String mPrint;
private String mStyle[];
private String mMaterial;
private String mBrand;
private String mStorageLocation;
private String mOptionalDescription;
private byte[] mImage;
public void writeToParcel(Parcel out, int flags) {
out.writeString(mClothingItemName);
out.writeLong(mClothesId);
out.writeString(mColor);
out.writeString(mPrint);
//out.writeStringArray(mStyle);
out.writeString(mMaterial);
out.writeString(mBrand);
out.writeString(mStorageLocation);
out.writeString(mOptionalDescription);
// out.writeByteArray(mImage);
}
private Clothes(Parcel in) {
mClothingItemName = in.readString();
mClothesId = in.readLong();
mColor = in.readString();
mPrint = in.readString();
// in.readStringArray(mStyle);
mMaterial = in.readString();
mBrand = in.readString();
mStorageLocation = in.readString();
mOptionalDescription = in.readString();
//in.readByteArray(mImage);
}
Upvotes: 0
Views: 143