Created
February 8, 2020 04:58
-
-
Save roscrazy/0f3c1a43f2058f5490bebdd7a30e8f7a to your computer and use it in GitHub Desktop.
RxLocationManager SetCancellable
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
emitter.setCancellable(getCancellable(listener)) | |
... | |
private fun getCancellable(locationListener: LocationCallback): Cancellable { | |
return Cancellable { | |
log { "FusedLocationService Observable has canceled" } | |
fusedLocationProviderClient.removeLocationUpdates(locationListener) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment