Skip to content

Instantly share code, notes, and snippets.



Last active Oct 31, 2017
What would you like to do?
protected var locationServiceConnection: ServiceConnection = object : ServiceConnection {
override fun onServiceConnected(className: ComponentName, service: IBinder) {
// This is called when the connection with the service has been
// established, giving us the service object we can use to
// interact with the service. Because we have bound to a explicit
// service that we know is running in our own process, we can
// cast its IBinder to a concrete class and directly access it.
locationService = (service as MyLocationService.LocalBinder).service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment