Disable Software Keyboard in Android until EditText is chosen

前端 未结 3 969
悲&欢浪女
悲&欢浪女 2021-02-06 19:28

how can I prevent the software keyboard to disappear until a specific EditText is choosen? I have several EditTexts in my Layout when it is opened the first is automatically sel

3条回答
  •  面向向阳花
    2021-02-06 20:19

    In your activity onCreate()

    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
    

提交回复
热议问题