I have seen many parcelable examples so far, but for some reason I can\'t get it to work when it gets a bit more complex. I have a Movie object, which implements Parcelable.
From the javadocs for readTypedList
:
Read into the given List items containing a particular object type that were written with
writeTypedList(List)
at the current dataPosition()
. The list must have previously been written via writeTypedList(List)
with the same object type.
You wrote them with a plain
dest.writeList(reviews);
reviews
and authors
are both null. You should first initialize the ArrayList. One way to do this is chain the constructor:
public Movie (Parcel in) {
this();
readFromParcel(in);
}