How to setOnEditorActionListener with Kotlin

The onEditorAction returns a Boolean while your Kotlin lambda returns Unit. Change it to i.e:

editText.setOnEditorActionListener { v, actionId, event ->
      if(actionId == EditorInfo.IME_ACTION_DONE){
          doSomething()
          true
      } else {
          false
      }
}

The documentation on lambda expressions and anonymous functions is a good read.

Leave a Comment

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