I have two textEdits and a bunch of buttons that serve as an input to these two textEdits (similar to a calculator). How do I prevent the softkeyboard from appearing when the use presses on any of the textEdits and allow my buttons to input the values as they are pressed.
To summarize:
I want to prevent system soft keyboard from appearing when textEdit is active.
I want my buttons to be the input source to my two textEdits.
Finally, how do I know in my buttons listener which TextEdit is active so that I can append the number pressed.
The following picture shows an example:
I found the solution:
first you need to disable the input method for your textEdit as follow:
yourTextEdit.setInputType(InputType.TYPE_NULL);
the above will prevent the soft keyboard from being an input to your textEdit
They in your button listener .setOnClickListener
you can identify which textEdit is active by checking yourTextEdit.isFocused()
and do whatever you want to do in your listener.
Hope this helps someone out there