From 6850e6e8e8ba7a2f9b5b565169abd4f40783d806 Mon Sep 17 00:00:00 2001 From: dkhawk Date: Fri, 26 Apr 2024 10:23:51 -0600 Subject: [PATCH] Use rememberSaveable to remember the marker type page --- .../src/main/java/com/example/mountainmarkers/MainActivity.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solution/app/src/main/java/com/example/mountainmarkers/MainActivity.kt b/solution/app/src/main/java/com/example/mountainmarkers/MainActivity.kt index edc14f7..32deca0 100644 --- a/solution/app/src/main/java/com/example/mountainmarkers/MainActivity.kt +++ b/solution/app/src/main/java/com/example/mountainmarkers/MainActivity.kt @@ -25,7 +25,7 @@ import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf -import androidx.compose.runtime.remember +import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalConfiguration @@ -69,7 +69,7 @@ class MainActivity : ComponentActivity() { dynamicColor = false ) { // Remember the type of marker we want to show - var selectedMarkerType by remember { + var selectedMarkerType by rememberSaveable { mutableStateOf(MarkerType.Basic) }