saket
10/05/2021, 10:11 PMAbstractComposeView
to our app, I’m noticing that my states aren’t getting saved (using rememberSaveable
) when the view is detached from window. I’m trying to investigate this for some time but I haven’t reached anywhere. How can I investigate what might be happening?setViewCompositionStrategy
which is DisposeOnDetachedFromWindow
.Andrey Kulikov
10/05/2021, 10:31 PMsaket
10/05/2021, 10:35 PMAbstractComposeView
Ian Lake
10/05/2021, 10:51 PMDisposeOnDetachedFromWindow
is always too early, as per the docs: https://developer.android.com/jetpack/compose/interop/interop-apis#composition-strategyTransition
saket
10/06/2021, 2:47 AMAbstractComposeView
implementation’s onSaveInstanceState()
is getting called. Is there anything else I can check?Zach Klippenstein (he/him) [MOD]
10/06/2021, 3:01 PMsaket
10/06/2021, 3:19 PMDoes your navigation system support SavedStateRegistry? Compose uses that instead of instance stateI think it does because
LocalSaveableStateRegistry.current
is non-null?Zach Klippenstein (he/him) [MOD]
10/06/2021, 3:26 PMsaket
10/06/2021, 3:49 PMIan Lake
10/06/2021, 4:27 PMsaket
10/06/2021, 5:43 PM