How to hide Android soft keyboard on EditText

前端 未结 16 1114
长发绾君心
长发绾君心 2020-11-27 14:38

I have an Activity with some EditText fields and some buttons as a convenience for what normally would be used to populate those fields. However when we the user touches on

16条回答
  •  情深已故
    2020-11-27 15:05

    The soft keyboard kept rising even though I set EditorInfo.TYPE_NULL to the view. None of the answers worked for me, except the idea I got from nik431's answer:

    editText.setCursorVisible(false);
    editText.setFocusableInTouchMode(false);
    editText.setFocusable(false);
    

提交回复
热议问题