Handle enter key in EditText across different devices

前端 未结 3 1291
温柔的废话
温柔的废话 2021-02-14 11:07

Right now I\'m handling the enter key in my EditText fields using a an onEditorActionListener and looking at the Action ID for IME_NULL. It works fine for all my users except o

3条回答
  •  清歌不尽
    2021-02-14 11:14

    I figured out how to get it to work.

    I had to add android:singleLine="true" to the EditText tag in the layout XML (alternately you can set it by using setSingleLine() in code). This forces the edit text to use only one line and focus will go to the next EditText box.

提交回复
热议问题