A short console example simulates an Android screen where SavedStateHandle stores the state of an expanded card between recreations. After recreation, a new data list arrives in a different order, and the application prints the final screen state.
main, restoreUiState, or render.stdout.SavedStateHandle already contains data from the previous instance of the screen.Main.kt.render().Run command:
kotlinc Main.kt -include-runtime -d app.jar && java -jar app.jar
stdout line.| characters.SavedStateHandle model is simplified to MutableMap<String, Any?>Click a line and write what it prints. Explanation is optional.