hi, i want to hide the soft keyboard when i click out side of editbox in a screen. how can i do this?
A:
To forcibly hide the keyboard you would use the following code... I put it in a method called 'hideSoftKeyboard()'. As mentioned by Falmarri, the softkeyboard should hide itself when you click out of it. However, if you call this method in an 'onClick()' of another item, it will forcibly close the keyboard.
private void hideSoftKeyboard(){
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(yourEditTextHere.getWindowToken(), 0);
}
__nv__
2010-10-24 16:22:40