How to pass a parcelable object that contains a list of objects?

后端 未结 9 1008
眼角桃花
眼角桃花 2020-12-04 08:12

I have created a Parcelable object below, my object contains a List of Products. In my constructor how do I handle re-creating my Parcelable<

9条回答
  •  半阙折子戏
    2020-12-04 08:50

    If class Product is compatible with parcelable protocol, following should work according to documentation.

    products = new ArrayList();
    in.readList(products, Product.class.getClassLoader());
    

提交回复
热议问题