Writing arrays of Parcelables to a Parcel in Android

后端 未结 3 1788
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-12 21:31

I\'m trying to write an array of objects that implement Parcelable into a Parcel using writeParcelableArray.

The objects I\'m trying to write are defined (as you\'

3条回答
  •  执念已碎
    2021-01-12 22:06

    Actually, you can extend an interface, and it looks like you need to do just that. The generics parameter in writeParcelableArray is asking for an extended interface (not the interface itself). Try creating an interface MyParcelable extends Parcelable. Then declaring your array using the interface, but the impl should be your Arrival extends MyParcelable.

提交回复
热议问题