Here is my model class:
public enum Action {
RETRY, SETTINGS
}
private int imageId;
private String description;
private String actionName;
private Action ac
One way to do this is to write Actions in integer and read them properly as integer and convert them into Action. What I mean:
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(this.imageId);
dest.writeString(this.description);
dest.writeString(this.actionName);
int actionAsInt = action == Action.RETRY ? 1 : 0;
dest.writeInt(actionAsInt);
}
protected NetworkError(Parcel in) {
this.imageId = in.readInt();
this.description = in.readString();
this.actionName = in.readString();
int actionAsInt = in.readInt();
this.action = actionAsInt == 1 ? Action.RETRY : Action.SETTINGS;
}
Try it. Success ...