0

I would like to know how to show and disappear the keyboard on my android application because when the keyboard appears to write to the EditText, the keyboard covers the buttons on my app and I can not disappear them to push the button ..

My android application does not handle vertically scrooll do not know if this works or is there a way to put vertical scroll.

Any suggestions on this?

Thanks

  • Are you sure you want the keyboard to disappear? How will the user enter the text then? Shouldn't you rather fix the scrolling issue? – matiash Jun 05 '14 at 02:06

1 Answers1

0

You can hide/show the android keyboard programmatically using the InputMethodManager class

InputMethodManager keyboard = (InputMethodManager)
            getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(0, InputMethodManager.SHOW_IMPLICIT); //show keyboard
imm.toggleSoftInput(0, InputMethodManager.HIDE_IMPLICIT_ONLY); //hide keyboard

I'd recommend running input completion logic on the EditText and calling the hide keyboard command when complete, or you could run a timer on a separate thread.

Hope this helps!

Freestyle076
  • 1,378
  • 16
  • 32