https://kotlinlang.org logo
#android
Title
# android
j

Jason Inbody

08/10/2021, 1:46 AM
How do I bing a service with kotlin
bindService
doesn't work. Whats the kotlin equivalent?
Copy code
private fun initiateNokeService() {
    val nokeServiceIntent = Intent(this.user.context, NokeDeviceManagerService::class.java)
    bindService(nokeServiceIntent, mServiceConnection, Context.BIND_AUTO_CREATE)
}
thats the function I'm trying to implement but can't seem to figure out how to bind the service
In order to use
bindService
you need to grab it from
context.bindService
4 Views