hello everyone, I couldn't make this data class as Parclable, the OData and orderItem: List<OrderItem> always has problems and i couldn't solve them the Question is how I can add them inside that parclable ??
thanks
Copy code
data class Order(
@SerializedName("data")
val data: OData? = null,
@SerializedName("success")
val success: Boolean? = null,
@SerializedName("message")
var message: String? = null,
@SerializedName("order_item")
val orderItem: List<OrderItem>? = null
)
t
Tamas Balogh
09/05/2019, 12:59 PM
Have you tried making OData and OrderItem parcelable, too?
🙏 1
Tamas Balogh
09/05/2019, 1:00 PM
I mean Parcelable is not transitive, every class used in your data class must implement Parcelable.
🙏 1
Tamas Balogh
09/05/2019, 1:01 PM
Something like that
Copy code
@Parcelize
data class Order(
@SerializedName("data")
val data: OData? = null,
@SerializedName("success")
val success: Boolean? = null,
@SerializedName("message")
var message: String? = null,
@SerializedName("order_item")
val orderItem: List<OrderItem>? = null
):Parcelable
🙏 1
Tamas Balogh
09/05/2019, 1:03 PM
Copy code
@Parcelize
data class OData(
//... anything else OData has
):Parcelable
@Parcelize
data class OrderItem(
//... anything else OrderItem has
):Parcelable