I have a data class "MyCard" that is passed into a view object (Android Studio). Here is MyCard class:
@kotlinx.serialization.Serializable(with=MyCardAsStringSerializer::class)
@SerialName("MyCard")
data class MyCard(
val imgResource: Int,
val cardTitle: String,
val cardDate: String,
val cardDescription: String,
// chart
val lineChart: LineChart
)
I am trying to serialize this object. However, due to the inclusion of the lineChart object, I am having issues (Line chart from MPChart).
I am trying to recreate the object from an intent, by doing something like
val myCard = intent.getSerializableExtra(intent__MYCARD_OBJ)
I have looked at Kotlin's guide to serialization (https://kotlinlang.org/docs/serialization.html#example-json-serialization) and other SO posts (Kotlin serialization: Serializer has not been found for type 'UUID') but am not sure where to go here.
Edit (08/31/22):
object MyCardAsStringSerializer : KSerializer<MyCard>{
override val descriptor: SerialDescriptor
get() = TODO("Not yet implemented")
override fun deserialize(decoder: Decoder): MyCard {
TODO("Not yet implemented")
}
override fun serialize(encoder: Encoder, value: MyCard) {
TODO("Not yet implemented")
}
}