更新时间:2022-12-11 11:42:36
您 DoctorObject#writeToParcel()
不能为空,这实际上是复制对象数据的内容。
You can't have DoctorObject#writeToParcel()
empty, that is what actually copies the object data.
@Override
public void writeToParcel(Parcel dest, int flags) {
// the order you write to the Parcel has to be the same order you read from the Parcel
dest.writeInt(DocPic);
dest.writeString(Docname);
dest.writeString(Docspecialty);
dest.writeString(DocLocation);
}
要在其他活动中读回数据,请使用 getParcelableArrayListExtra
And to read back your data in the other activity, use getParcelableArrayListExtra
ArrayList<DoctorObject> list = b.getParcelableArrayListExtra("NAME");