Created
April 11, 2023 15:13
-
-
Save RaheemJnr/2783b06b150fdf3640b1d2fd0395d71e to your computer and use it in GitHub Desktop.
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
fun stopLocationUpdate() { | |
try { | |
//Removes all location updates for the given callback. | |
val removeTask = locationProvider.removeLocationUpdates(locationCallback) | |
removeTask.addOnCompleteListener { task -> | |
if (task.isSuccessful) { | |
Log.d(LOCATION_TAG, "Location Callback removed.") | |
} else { | |
Log.d(LOCATION_TAG, "Failed to remove Location Callback.") | |
} | |
} | |
} catch (se: SecurityException) { | |
Log.e(LOCATION_TAG, "Failed to remove Location Callback.. $se") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment