<https://developer.android.com/codelabs/jetpack-co...
# compose
a
https://developer.android.com/codelabs/jetpack-compose-basics and https://developer.android.com/codelabs/jetpack-compose-state ...talk about using `TextField`s and
remember
. But they don't mention that, if you want the content to persist after configuration changes (screen rotation), you need
rememberSaveable
The docs do mention it, of course. But the pathway doesn't. If anyone from Google reads this, it may be worth mentioning it in the pathway. I completely forgot about it and released an app.
a
Hmm. Won't that prevent app rotation?
a
No.
compose will react and update granularly for any of them
a
Interesting. Thanks. I should try it.
What if your apps in the background, killed by android, and is recreated? Then your text field will be empty, surely.
a
In that case you need
rememberSaveable
, yes.
a
Still, the pathway should mention
rememberSaveable
really. In apps which aren't compose first, or apps which the system kills, then the user will be confused why their text field text, or whatever, has been obliterated.
Also, if you use
configChanges="orientation"
etc in compose-first apps then `AndroidView`s won't get alternative XML styles, and I've found I need to use those for things like
CalendarView
which demands certain styling be done via the theming system alone.