Android Parcelable List

If you have a List in the class that is implementing Parcelable:


public class myClass implements Parcelable{
private List myList;


...
protected myClass(Parcel in) {
this.myList = new LinkedList();
in.readList(myList, myClass.class.getClassLoader());
}


...
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeList(myList);
}
}