Akbolat’s Workshop

ViewModel vs rememberSaveable

Investigation on a new Save/Restore thing from Jetpack Compose

It’s the question I asked Google, while was passing one of their trainings they’re advertising last month. It’s called Compose Camp. Where you can earn badges( the reason I attempted) and certificate.

Back to the topic. I didn’t find anything clear about it. So made a quick overview, not deep research, leaving it to someone else.

Here is the question from one of the quiz:

Sorry for the spoiler

What is rememberSaveable according to the docs:

It behaves similarly to remember, but the stored value will survive the activity or process recreation using the saved instance state mechanism (for example it happens when the screen is rotated in the Android application).