Parcelable
私はParcelable Classのすべてのフィールドの実用的な実装を持っています.List<List<String>>
class Employee implements Parcelable {
List<List<String>> details;
//.......
protected Employee(Parcel in) {
details = new ArrayList<List<String>>();
// i know this is wrong just posting to clarify
in.readList(details, List.class.getClassLoader());
//......
}
public void writeToParcel(Parcel dest, int flags) {
dest.writeList(details);
//.....
}
public int describeContents() {
return 0;
}
public static final Parcelable.Creator<Employee> CREATOR =
new Parcelable.Creator<Employee>() {
public Employee createFromParcel(Parcel in) {
return new Employee(in);
}
public Employee[] newArray(int size) {
return new Employee[size];
}
};
}
例外:
05-10 19:07:44.072: E/AndroidRuntime(10661): Caused by: java.lang.RuntimeException: Parcel android.os.Parcel@42a509e8: Unmarshalling unknown type code 3604535 at offset 268