How to disable Android Soft Keyboard for a particular activity?

后端 未结 6 1766
南旧
南旧 2021-02-08 11:03

I have an activity with one EditText where I need to input numbers only.

Now, I have defined the Input Type for my EditText to be number only and have drawn up a pretty

6条回答
  •  庸人自扰
    2021-02-08 12:01

    Use the android:windowSoftInputMode="stateHidden" in your activity in manifest file. This will work. Don't use the android:focusable="false" for EditText unless if you are not willing to input the text. If you want to give input then remove that property for the edittext in the layout file.

提交回复
热议问题