Skip to content

Instantly share code, notes, and snippets.

@sagar-viradiya
Created September 26, 2021 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sagar-viradiya/c885e6bcb49295c34e28576bbf8d8c2e to your computer and use it in GitHub Desktop.
Save sagar-viradiya/c885e6bcb49295c34e28576bbf8d8c2e to your computer and use it in GitHub Desktop.
Example of observing location updates through callback-ktx
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