Arraylist in parcelable object

前端 未结 2 1329
傲寒
傲寒 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:15

    reviews and authors are both null. You should first initialize the ArrayList. One way to do this is chain the constructor:

    public Movie (Parcel in) {
       this();
       readFromParcel(in); 
    }
    

提交回复
热议问题