How to disable Android Soft Keyboard for a particular activity?

后端 未结 6 1753
南旧
南旧 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 11:45

    You can try this. It is working for me:

    getWindow().setFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM,
                         WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
    

提交回复
热议问题