Last active
September 26, 2021 15:14
-
-
Save sagar-viradiya/15ab3878da4baba4c9a83abacf3ebbec to your computer and use it in GitHub Desktop.
Example of getting last location through callback-ktx
This file contains hidden or 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 { | |
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