I’m curious, has anyone found a better way to maintain View State between screen navigations, like scroll position, besides doing something like state hoisting?
i
Ian Lake
09/20/2022, 8:24 PM
Anything using
rememberSaveable
(such as
rememberScrollState
) is already saved and restored if you are using Navigation Compose. What kind of setup are you using where saveable isn't saving?
s
spierce7
09/20/2022, 8:26 PM
oh - I thought saveable was just for configuration changes. Nevermind.
i
Ian Lake
09/20/2022, 9:22 PM
It is more that by handling config changes and process death and recreation correctly (which you really must do), you automatically support every other case where you need to save and restore state (as they all hook into the same APIs)