Sending Nested Parcelable with Intent

前端 未结 3 1193
粉色の甜心
粉色の甜心 2021-01-21 10:31

I am trying to send a Parcelable object which also contains another Parcelable object with Intent. However, I am getting NullPointer Exception. Could you please tell me where I

3条回答
  •  -上瘾入骨i
    2021-01-21 11:36

    You have to instanciate your ArrayList< B > in :

     private A (Parcel in){
        var = new ArrayList();
        in.readTypedList(this.var, B.CREATOR);
    }
    

    Say if it works :)

提交回复
热议问题