假设您有一些Serializable类,您在某些库(LibClass)
中有你有自己的班级
class Foo implements Parcelable {
private List<LibClass> mLibraryList;
public static final Parcelable.Creator<Foo > CREATOR
= new Parcelable.Creator<Foo >() {
public Foo createFromParcel(Parcel in) {
return new Foo (in);
}
public Foo [] newArray(int size) {
return new Foo [size];
}
};
}
问题是 - 如何从Parcel创建构造函数?
private Foo(Parcel in) {
in.readList(mLibraryList, ???); // whoaps! where is the loader for lib class?
}