Last active
April 26, 2020 12:18
-
-
Save Lavanyagaur22/60ab8a93bb12f22d5992ebde06f2cb61 to your computer and use it in GitHub Desktop.
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
fusedLocationProviderClient.lastLocation.apply { | |
addOnFailureListener{ | |
//Handle the failure of the call. You can show an error dialogue or a toast stating the failure in receiving location. | |
} | |
addOnSuccessListener { | |
//Got last known location. (Can be null sometimes) | |
//You ca extract the details from the client, like the latitude and longitude of the place and use it accordingly. | |
myLat = it.latitude | |
myLong = it.longitude | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment