onEditorAction() is not called after Enter key has been pressed on Jelly Bean emulator

后端 未结 2 1446
轮回少年
轮回少年 2021-02-07 01:57

I\'m having a problem with the behavior of the latest Jelly Bean emulator. I have several EditTexts in my app. An OnEditorActionListener provides speci

2条回答
  •  有刺的猬
    2021-02-07 02:35

    If someone else finds this question:

    I've tested this several times and on the Jelly Bean emulator the listener callback method onEditorAction() indeed no longer gets called when the Enter key is pressed on the virtual keyboard.

    As I mentioned above a possible solution or workaround is to replace the Enter key with one of the available action keys. Those still trigger onEditorAction(). I also had to specify the input type.

    editText.setRawInputType(InputType.TYPE_CLASS_TEXT);
    editText.setImeOptions(EditorInfo.IME_ACTION_GO);
    
    

提交回复
热议问题