Skip to content

Instantly share code, notes, and snippets.

@yusufceylan
Created September 7, 2020 11:36
Show Gist options
  • Save yusufceylan/b0be325b8117bee9167919463bf39c9d to your computer and use it in GitHub Desktop.
Save yusufceylan/b0be325b8117bee9167919463bf39c9d to your computer and use it in GitHub Desktop.
Huawei Location Kit - Remove Location Updates
fun unregisterLocationUpdates() {
mLocationCallback?.let { locationCallback ->
mFusedLocationProviderClient.removeLocationUpdates(locationCallback)
.addOnSuccessListener {
// Requesting location updates is stopped successfully.
LogUtils.d("LocationKit -> Stop Listening Location Successfully")
}
.addOnFailureListener {
// Failed to stop requesting location updates.
LogUtils.d("LocationKit -> Stop Listening Location Failed with exception: ${it.localizedMessage}")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment