Skip to content

Instantly share code, notes, and snippets.

@intari
Last active October 31, 2017 09:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save intari/105574121c21fe94adad97abc604a6e9 to your computer and use it in GitHub Desktop.
Save intari/105574121c21fe94adad97abc604a6e9 to your computer and use it in GitHub Desktop.
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=(MySLocationService.LocalBinder)service;
locationService = (service as MyLocationService.LocalBinder).service
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment