Android EditText Detect Done Action

March 12, 2019
Change Enter Key to imeOptions Done
editText.setOnEditorActionListener { textView, actionId, keyEvent ->
    if (actionId == EditorInfo.IME_ACTION_DONE) {

        // do something

        return@setOnEditorActionListener true
    }
    false
}
<EditText
    android:id="@+id/editText"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:inputType="textCapWords"
    android:imeOptions="actionDone"
    />
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.