I have an EditText object input which i am dynamically creating. I simply don't want the keypad to popup when i select the EditText object to enter text because i have made different buttons and set OnClickListner-s for all of them which will do the inputs but when the keypad pops up it covers the screen and i want to disable it because i don't want anyone to enter text from the keypad. i only want them to enter values from the buttons i have created.
Asked
Active
Viewed 561 times
2
-
See http://stackoverflow.com/questions/10611833/how-to-disable-keypad-popup-when-on-edittext – Marcin Koziński May 26 '16 at 20:02
-
I have already seen this question but its not the answer i am looking for. I dont want the keypad to popup even when i select it. – Diptangsu Goswami May 26 '16 at 20:29
2 Answers
3
You can disable showing the keyboard with this:
editText.setInputType(InputType.TYPE_NULL);
And you can show it again with:
editText.requestFocus();
editText.setInputType(InputType.TYPE_CLASS_TEXT);
final InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
Handler handler = new Handler();
Runnable r = new Runnable() {
public void run() {
imm.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT);
}
};
handler.postDelayed(r, 100);

Cheese Bread
- 2,246
- 1
- 13
- 14
0
Try with setting android:inputType="none" in your edittext or following this thread