Let's say I have an orders
array. Now, suppose inside each order I have a sellers
array.
By making the Order
class parcelable, it is not working the array of Seller
s out.
I tried doing this:
class Order() : Parcelable {
[...]
constructor(parcel: Parcel) : this() {
id = parcel.readString()
name = parcel.readString()
sellers = parcel.readparcel(Seller::class.java) // (I added this line)
}
override fun writeToParcel(parcel: Parcel, flags: Int) {
parcel.writeString(id)
parcel.writeString(name)
parcel.writeparcelabl(sellers, flags) // (I added this line)
}
}
But it didn't work. Any ideas?