F
F
foonfyrick2020-10-30 10:44:15
Android
foonfyrick, 2020-10-30 10:44:15

Room, model Parcelable or not, difference?

If you remove the @Parcelize annotation and inheritance of the Parcelable interface, then nothing will change in working with the database, then why put it in the examples? I tried both with and without the Parcelfble interface, according to my observations, everything works the same way.

@Parcelize
@Entity(tableName = "test_table")
data class User (
    @PrimaryKey(autoGenerate = true)
    val id:Int,
    val name:String,
    val age:String
):Parcelable

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
illuzor, 2020-10-30
@foonfyrick

Working with room does not require Parcelable.
It is possible that these models are supposed to be transferred via bundle somewhere in other places of the program.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question