For compose `rememberSaveable`, are the variables ...
# compose
e
For compose
rememberSaveable
, are the variables restore sequence per the order of the line coded? I have a case where it seems that way (or perhaps a Google bug?). To explain clearly what I meant with full code in https://stackoverflow.com/questions/73947154/remembersaveable-restore-value-type-influenced-by-the-order-of-the-code Can someone help? 🙏
z
Which version of compose are you using? I thought this bug was fixed a while ago
e
You're right. I was using the default Jetpack Compose version generated by Android Studio Dolphin project, i.e. 1.1.1 When I switch over to version 1.2.0, this issue is fixed. Thanks!
However, I face new issue with 1.2.0 I have
Copy code
Unresolved reference: ViewTreeSavedStateRegistryOwner
I'm using
import androidx.savedstate.ViewTreeSavedStateRegistryOwner
What has changed? Can I still have access to
import androidx.savedstate.ViewTreeSavedStateRegistryOwner
?
I think I got the answer. Use
Copy code
import androidx.savedstate.findViewTreeSavedStateRegistryOwner
import androidx.savedstate.setViewTreeSavedStateRegistryOwner
instead
Thanks 🙏