有错误的行:
PersonList persons;
persons = (PersonList) intent.getParcelableArrayListExtra(EXTRA_PERSON_LIST);
PersonList的声明方式:
public class PersonList extends ArrayList<Person> {
人员申报方式:
public class Person extends CommonObject implements Parcelable {
由于PersonList扩展了ArrayList(Person),Person实现了Parcelable,所以不确定为什么这不起作用。
你不能用这种方式。
ArrayList<Person> l = ...;
PersonList p = (PersonList) l; // Not possible
PersonList p = ...;
ArrayList<Person> l = p; // This will work
PersonList
是Person
的ArrayList
Person
的ArrayList
并不总是PersonList