Provide Parcelable.Creator object called CREATOR

This commit is contained in:
Martin Fietz 2015-11-10 18:32:43 +01:00
parent 39fc94c6f2
commit cdd0d968cf
1 changed files with 15 additions and 5 deletions

View File

@ -20,11 +20,10 @@ public class GpodnetTag implements Parcelable {
this.usage = usage;
}
public static GpodnetTag createFromParcel(Parcel in) {
final String title = in.readString();
final String tag = in.readString();
final int usage = in.readInt();
return new GpodnetTag(title, tag, usage);
protected GpodnetTag(Parcel in) {
title = in.readString();
tag = in.readString();
usage = in.readInt();
}
@Override
@ -56,5 +55,16 @@ public class GpodnetTag implements Parcelable {
dest.writeInt(usage);
}
public static final Creator<GpodnetTag> CREATOR = new Creator<GpodnetTag>() {
@Override
public GpodnetTag createFromParcel(Parcel in) {
return new GpodnetTag(in);
}
@Override
public GpodnetTag[] newArray(int size) {
return new GpodnetTag[size];
}
};
}