I have a class called ClassA
which contains a List
of ClassB
objects. Both classes implement Parcelable
.
I am trying to create the read/write methods for this list in ClassA
and am having trouble. For example I tried:
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeList(mClassBList);
}
but then
private ClassA(Parcel in) {
mClassBList = in.readList();
}
throws an error because it needs all these extra arguments.
How do I correctly read/write this List
?