adjpd
01/29/2022, 4:18 PMrememberSaveable {}
on a custom class that implements Parcelable
. This saves and restores the object on screen rotation perfectly. All the warning messages, however, tell me that this should not work. Can you help me understand the warning messages? And help me understand if I'm doing something wrong? Code and warnings in 🧵@Parcelize
class MyState() : Parcelable {
private var _inputText by mutableStateOf("")
val inputText by derivedStateOf { _inputText }
val inputTextChange = { s:String ->
_inputText = s
}
}
rememberSaveable { MyState() }
The primary constructor is empty, no data will be serialized to 'Parcel'
And this x3
Property would not be serialized into a 'Parcel'. Add '@IgnoredOnParcel' annotation to remove the warning
remember {}
)Paul Woitaschek
01/29/2022, 8:24 PMtheapache64
01/29/2022, 8:54 PMSaver
?Paul Woitaschek
01/29/2022, 8:58 PM