I am trying to get an advantage of auto-generated Parceable like (eg:) described here -
https://stackoverflow.com/a/63906355/5709159
or
As far as I see the only requirement is declare the class as Parcelable
and annotate it with @Parcelize
like this:
@Parcelize
class Person(val name: String, val age: Int) : Parcelable
however, I get an error that says:
Class 'Person' is not abstract and does not implement abstract member public abstract fun describeContents(): Int defined in android.os.Parcelable
It forces me to implement these methods:
@Parcelize
class Person(val name: String, val age: Int) : Parcelable {
override fun describeContents(): Int {
TODO("Not yet implemented")
}
override fun writeToParcel(dest: Parcel, flags: Int) {
TODO("Not yet implemented")
}
}
It is not what is expected, what am I missing here?