Skip to content

Instantly share code, notes, and snippets.

@dcalance
Created November 21, 2017 17:53
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 dcalance/1407cd1721ca44c544e4b34e3d66a0da to your computer and use it in GitHub Desktop.
Save dcalance/1407cd1721ca44c544e4b34e3d66a0da to your computer and use it in GitHub Desktop.
private val mConnection : ServiceConnection = object : ServiceConnection {
override fun onServiceConnected(className : ComponentName?, service : IBinder?) {
// We've bound to LocalService, cast the IBinder and get LocalService instance
val binder = service as DeserializeService.LocalBinder
mService = binder.getService()
mBound = true
appList = ArrayList(mService!!.getResult().asList())
list.adapter = listAdapter
updateAdapter()
}
override fun onServiceDisconnected(name: ComponentName?) {
mBound = false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment