# TextView.OnEditorActionListener

Added in[API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

# TextView.OnEditorActionListener

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/widget/TextView.OnEditorActionListener "View this page in Kotlin")\|Java

`
public
static


interface
TextView.OnEditorActionListener
`  
`


`

|------------------------------------------------|
| android.widget.TextView.OnEditorActionListener |

<br />

*** ** * ** ***

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

## Summary

|                                                                                                                                                                                                           ### Public methods                                                                                                                                                                                                            ||
|---------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract boolean` | ` `[onEditorAction](https://developer.android.com/reference/android/widget/TextView.OnEditorActionListener#onEditorAction(android.widget.TextView,%20int,%20android.view.KeyEvent))`(`[TextView](https://developer.android.com/reference/android/widget/TextView)` v, int actionId, `[KeyEvent](https://developer.android.com/reference/android/view/KeyEvent)` event) ` Called when an action is being performed. |

## Public methods

### onEditorAction

Added in[API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract boolean onEditorAction (TextView v, 
                int actionId, 
                KeyEvent event)
```

Called when an action is being performed.

<br />

|                                                                                                                                                                                                        Parameters                                                                                                                                                                                                        ||
|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `v`        | `TextView`: The view that was clicked. <br />                                                                                                                                                                                                                                                                                                                                                                |
| `actionId` | `int`: Identifier of the action. This will be either the identifier you supplied, or[EditorInfo.IME_NULL](https://developer.android.com/reference/android/view/inputmethod/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. <br /> |
| `event`    | `KeyEvent`: If triggered by an enter key, this is the event; otherwise, this is null. <br />                                                                                                                                                                                                                                                                                                                 |

|                                  Returns                                   ||
|-----------|-----------------------------------------------------------------|
| `boolean` | Return true if you have consumed the action, else false. <br /> |