Arraylist in parcelable object

前端 未结 2 1337
傲寒
傲寒 2020-12-08 00:42

I have seen many parcelable examples so far, but for some reason I can\'t get it to work when it gets a bit more complex. I have a Movie object, which implements Parcelable.

2条回答
  •  一向
    一向 (楼主)
    2020-12-08 01:02

    From the javadocs for readTypedList:

    Read into the given List items containing a particular object type that were written with writeTypedList(List)

    at the current dataPosition(). The list must have previously been written via writeTypedList(List) with the same object type.

    You wrote them with a plain

    dest.writeList(reviews);
    

提交回复
热议问题