I am also phase these error and i am little bit change in modelClass which are implemented Serializable interface like:
At that Model class also implement Parcelable interface with writeToParcel() override method
Then just got error to "create creator" so CREATOR is write and also create with modelclass contructor with arguments & without arguments..
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(id);
dest.writeString(name);
}
protected ArtistTrackClass(Parcel in) {
id = in.readString();
name = in.readString();
}
public ArtistTrackClass() {
}
public static final Creator<ArtistTrackClass> CREATOR = new Creator<ArtistTrackClass>() {
@Override
public ArtistTrackClass createFromParcel(Parcel in) {
return new ArtistTrackClass(in);
}
@Override
public ArtistTrackClass[] newArray(int size) {
return new ArtistTrackClass[size];
}
};
Here,
ArtistTrackClass -> ModelClass
Constructor with Parcel arguments "read our attributes" and writeToParcel() is "write our attributes"