0

How can I disable and enable the virtual keyboard when the user click on the EditText. If I use the instruction EditText.setInputType(InputType.TYPE_NULL); the cursor does not blink and when I set it not focusable the cursor disappear.

Besnik
  • 1
  • 2
  • Have you looked at this thread? [hide/display soft input] http://stackoverflow.com/questions/1109022/close-hide-the-android-soft-keyboard – GordonW Feb 26 '15 at 15:24

2 Answers2

0

Force open soft keyboard

((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);

Force close soft keyboard

((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(_pay_box_helper.getWindowToken(), 0);

Hope to work...

Kristiyan Varbanov
  • 2,439
  • 2
  • 17
  • 37
0
InputMethodManager imm = (InputMethodManager)getActivity().getSystemService(
          Context.INPUT_METHOD_SERVICE);
    imm.hideSoftInputFromWindow(your_edittext.getWindowToken(), 0);
    imm.showSoftInputFromWindow(your_edittext.getWindowToken(), 0);
mehmetunlu
  • 239
  • 2
  • 5