Zach Klippenstein (he/him) [MOD]
02/09/2021, 8:27 PMAndroidView
noticed that the view state of their nested Android view hierarchies isn’t being restored correctly either after config changes or navigation, or weird stuff with lifecycles?
I’ve been exploring some of these interactions and found what I’m pretty sure are a number of bugs. The README in this repo describes a number of the (potential) issues I found, but if people have found other repro cases it would probably be good to add them to the Google issue.aiidziis
02/09/2021, 8:29 PMHalil Ozercan
02/09/2021, 8:30 PMZach Klippenstein (he/him) [MOD]
02/09/2021, 9:06 PMIan Lake
02/10/2021, 1:40 AMZach Klippenstein (he/him) [MOD]
02/10/2021, 2:40 AMIan Lake
02/10/2021, 3:10 AMZach Klippenstein (he/him) [MOD]
02/10/2021, 3:12 AMaiidziis
02/12/2021, 2:20 PMalpha12
?Zach Klippenstein (he/him) [MOD]
02/12/2021, 3:05 PMjulioromano
02/12/2021, 11:20 PMonSaveInstanceState()
called but not onRestoreInstanceState()
?
(re: https://kotlinlang.slack.com/archives/CJLTWPH7S/p1613139840305500 )Zach Klippenstein (he/him) [MOD]
02/12/2021, 11:20 PMjulioromano
02/12/2021, 11:30 PMAndroid onRestoreInstanceState for Android views nested in ComposeViews is very broken, even when all known views have their IDs set:
It's not called after config changes.
I can confirm this happens with alpha12 even when not using ComposeView
: it is enough if the AndroidView
composable is loaded inside an Activity’s setContent {}
.Zach Klippenstein (he/him) [MOD]
02/12/2021, 11:59 PMAndroidComposeView
) – i should probably have been more precise about that in the readme, I just said ComposeView
since that’s the primary API that you’re probably going to use if you do a lot of switching between worlds like this.