OnEditorActionListener not working when testing


I’m using OnEditorActionListener on a EditText

scoreboardNameEdit.setOnEditorActionListener(new TextView.OnEditorActionListener() {
    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {

Everything worked well during development and when testing manually. Now i want to test it with Android Espresso


and the OnEditorActionListener does not get called

Is this a common problem with Android Espresso?


closeSoftKeyboard(): sounds to me like that is only hiding the keyboard. Try to use one of the different methods in ViewActions.

From the docs:

  • ViewActions#closeSoftKeyboard() : Returns an action that closes soft keyboard.

  • ViewActions#pressImeActionButton() : Returns an action that presses the current action button (next, done, search, etc) on the IME (Input Method Editor).

I would place my bet on pressImeActionButton() (untested offcourse)

Answered By – Entreco

Leave a Comment