How to remove focus and hide the on screen Keyboard

2 votes · 2 comments

On some systems, when an EditText field is selected, the focus is automatically shifted to the field and an onscreen keyboard is shown. This removes the onscreen keyboard.

raw ·
copy
· download
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(editTextField.getWindowToken(), 0);
Add a comment

2 Comments

Are you some kind of clairvoyant? It's just excactly what I was thinking about the last days... thanks! ;)

Reply · July 27, 2009, 2:24 p.m.

This is really helpful!

Reply · Aug. 8, 2009, 10:34 p.m.