Created
October 14, 2022 03:52
-
-
Save AndroidPoet/c9da7091d351959941ee1d4294113f92 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun rememberMapViewWithLifecycle() { | |
DisposableEffect(key1 = lifecycle, key2 = mapView) { | |
// Make MapView follow the current lifecycle | |
val lifecycleObserver = getMapLifecycleObserver(mapView) | |
lifecycle.addObserver(lifecycleObserver) | |
onDispose { | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment