Android Class Parcelable with ArrayList

后端 未结 4 1115
太阳男子
太阳男子 2020-11-30 01:42

I have an android project where I have a class. In that class is an ArrayList. I will be getting some XML, parsing it out, then making objects ou

4条回答
  •  误落风尘
    2020-11-30 02:36

    Use:

    in.createTypedArrayList(Product.CREATOR)
    

    In the constructor that takes a Parable object as a param.

    In the writeToParcel method use dest.writeTypedList(product);

提交回复
热议问题