1

I want to disable soft keyboard when we click some button without affecting selection or cursor. I tried many examples to disable edittext but nothing matched my requirement except this one.

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

The above line disables soft keyboard without affecting selection and cursor.

Now this line only works if I place it under onCreate(), otherwise not working. I want to disable editext when user click some actions. Thank you

Vijay
  • 545
  • 1
  • 5
  • 15

0 Answers0