How to clear focus and remove keyboard on Android?

后端 未结 6 2062
情歌与酒
情歌与酒 2021-02-01 18:41

I have a EditText control. If I tap it the softkeyboard will popup however when I press \"enter/ok/return\" then the EditText control it still has focus and the keyboard up.

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-01 19:31

    You could try doing SetFocus() on another element in your layout.

    If you are talking about the "enter/ok/return" button on the keyboard itself you may have to set up a KeyListener on the EditText control in order to know when to SetFocus() on another element.

提交回复
热议问题