Added in API level 3

OnEditorActionListener


interface OnEditorActionListener
android.widget.TextView.OnEditorActionListener

Interface definition for a callback to be invoked when an action is performed on the editor.

Summary

Public methods
abstract Boolean
onEditorAction(v: TextView!, actionId: Int, event: KeyEvent!)

Called when an action is being performed.

Public methods

onEditorAction

Added in API level 3
abstract fun onEditorAction(
    v: TextView!,
    actionId: Int,
    event: KeyEvent!
): Boolean

Called when an action is being performed.

Parameters
v TextView!: The view that was clicked.
actionId Int: Identifier of the action. This will be either the identifier you supplied, or EditorInfo.IME_NULL if being called due to the enter key being pressed. Starting from Android 14, the action identifier will also be included when triggered by an enter key if the input is constrained to a single line.
event KeyEvent!: If triggered by an enter key, this is the event; otherwise, this is null.
Return
Boolean Return true if you have consumed the action, else false.