I am new to Kotlin and a little stack with intent. The manifest shows me an error that my service does not contain a default constructor, but inside the service it looks normal and there are no errors.
Here is my intention for the Services:
class MyService : IntentService { constructor(name:String?) : super(name) { } override fun onCreate() { super.onCreate() } override fun onHandleIntent(intent: Intent?) { } }
I also tried another option:
class MyService(name: String?) : IntentService(name) {
but when I try to start this service, I still get the error message:
java.lang.Class<com.test.test.MyService> has no zero argument constructor
Any ideas on fixing the default constructor in Kotlin?
Thanks!
source share