matt tighe
07/25/2019, 11:32 PMsealed class Animal
object Dog : Animal()
object Cat : Animal()
@Entity
data class Person(
val name: String
val favoriteTypeOfAnimal: Animal
)
writing a type converter doesn’t seem to do itMark Murphy
07/25/2019, 11:39 PMmatt tighe
07/25/2019, 11:41 PMType is not directly supported by 'Parcelize'. Annotate the parameter type with '@RawValue' if you want it to be serialized using 'writeValue()'
sealed class Animal : Parcelable
@Parcelize
object Dog : Animal()
@Parcelize
object Cat : Animal()
@Entity
data class Person(
val name: String
val favoriteTypeOfAnimal: Animal
)
Mark Murphy
07/25/2019, 11:43 PMParcelable
is not meant to be a persistable typeParcelable
types, some people are going to shoot themselves in the foot (though your scenario may be fine)jw
07/26/2019, 12:08 AMmatt tighe
07/26/2019, 12:24 AM@Parcelize
as well. i believe that was so they could be passed in `Bundle`s. is that a bad practice?jw
07/26/2019, 12:27 AM