hello everyone, I couldn't make this data class as...
# android
a
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
Have you tried making OData and OrderItem parcelable, too?
🙏 1
I mean Parcelable is not transitive, every class used in your data class must implement Parcelable.
🙏 1
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
Copy code
@Parcelize
data class OData(
    //... anything else OData has
):Parcelable


@Parcelize
data class OrderItem(
    //... anything else OrderItem has
):Parcelable
🙏 1
a
many thanks, @Tamas Balogh i will try it out
👍 1