Skip to content

Instantly share code, notes, and snippets.

@sagar-viradiya
Last active 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/15ab3878da4baba4c9a83abacf3ebbec to your computer and use it in GitHub Desktop.
Save sagar-viradiya/15ab3878da4baba4c9a83abacf3ebbec to your computer and use it in GitHub Desktop.
Example of getting last location through callback-ktx
viewLifecycleOwner.lifecycleScope.launch {
val location = fusedLocationProviderClient.awaitLastLocation() // Suspend coroutine
// Use location
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment