Created
September 26, 2021 15:14
-
-
Save sagar-viradiya/c885e6bcb49295c34e28576bbf8d8c2e to your computer and use it in GitHub Desktop.
Example of observing location updates through callback-ktx
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
viewLifecycleOwner.lifecycleScope.launch { | |
fusedLocationProviderClient.locationFlow(locationRequest, lifecycleOwner).collect { location -> | |
// Consume location | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment