In my Application I have class which contains a List of List to which I want to make Parcelable
to particular class so far I have tried
public class FeaturesParcelable implements Parcelable {
private List<List<SpinnerModel>> featuresSublist;
public List<List<SpinnerModel>> getFeaturesSublist() {
return featuresSublist;
}
public void setFeaturesSublist(List<List<SpinnerModel>> featuresSublist) {
this.featuresSublist = featuresSublist;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeList(this.featuresSublist);
}
public FeaturesParcelable() {
}
protected FeaturesParcelable(Parcel in) {
this.featuresSublist = new ArrayList<List<SpinnerModel>>();
in.readList(this.featuresSublist, List<SpinnerModel>.class.getClassLoader());
}
public static final Parcelable.Creator<FeaturesParcelable> CREATOR = new Parcelable.Creator<FeaturesParcelable>() {
@Override
public FeaturesParcelable createFromParcel(Parcel source) {
return new FeaturesParcelable(source);
}
@Override
public FeaturesParcelable[] newArray(int size) {
return new FeaturesParcelable[size];
}
};
}
but I getting an error cannot select from parameterized type inside
protected FeaturesParcelable(Parcel in) {
this.featuresSublist = new ArrayList<List<SpinnerModel>>();
in.readList(this.featuresSublist, List<SpinnerModel>.class.getClassLoader());
}