Solution 1 :
I forgot to put this line of code. I want to convert this but it keeps giving me an error: can’t put in the database, try an typeconverter for it.
@SerializedName("image") var imagePath: Image,
Problem :
I have made a room database, and this is the error I get:
This is my Image class:
@Parcelize
data class Image(
@SerializedName("src") var productImgPath: String
) : Parcelable
this is my type converter
@TypeConverter
fun imgFromString2(value: String): Image {
val listType: Type = object : TypeToken<Image>() {}.type
return Gson().fromJson(value, listType)
}
Comments
Comment posted by sidgate
what is the value of
Comment posted by Gg M
try use list of String instead of list of Image.also print the