java.lang.IllegalArgumentException : Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull

The last parameter can be null, as described by the docs:

KeyEvent: If triggered by an enter key, this is the event; otherwise, this is null.

So what you have to do is make the Kotlin type nullable to account for this, otherwise the injected null check will crash your application when it gets a call with a null value as you’ve already seen it:

edtSearch?.setOnEditorActionListener(object : TextView.OnEditorActionListener {
    override fun onEditorAction(v: TextView, actionId: Int, event: KeyEvent?): Boolean {
        ...
    }
})

More explanation about platform types in this answer.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)