public class Category implements Parcelable {
private int mCategoryId;
private List<Video> mCategoryVideos;
public int getCategoryId() {
return mCategoryId;
}
public void setCategoryId(int mCategoryId) {
this.mCategoryId = mCategoryId;
}
public List<Video> getCategoryVideos() {
return mCategoryVideos;
}
public void setCategoryVideos(List<Video> videoList) {
mCategoryVideos = videoList;
}
@Override
public void writeToParcel(Parcel parcel, int i) {
parcel.writeInt(mCategoryId);
parcel.writeTypedList(mCategoryVideos);
}
public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
public Category createFromParcel(Parcel parcel) {
final Category category = new Category();
category.setCategoryId(parcel.readInt());
category.setCategoryVideos(parcel.readTypedList()); */// **WHAT SHOULD I WRITE HERE***
return category;
}
public Category[] newArray(int size) {
return new Category[size];
}
};
}
我的代码我正在使用从 parcelable 实现的模型...谁能告诉他们我在这一行中写了什么我category.setCategoryVideos(parcel.readTypedList())
找不到任何有用的帖子。
编辑:category.setCategoryVideos(parcel.readTypedList(mCategoryVideos,Video.CREATOR));
在这里 mCategoryVideos 我无法解决错误。