Skip to content

Instantly share code, notes, and snippets.

InputMethodManager imm = (InputMethodManager)getSystemService(INPUT_METHOD_SERVICE);
@Override
public boolean onTouchEvent(MotionEvent event) {
// TODO Auto-generated method stub
if(event.getAction() == MotionEvent.ACTION_DOWN){
if(getCurrentFocus()!=null && getCurrentFocus().getWindowToken()!=null){
imm.hideSoftInputFromWindow
(getCurrentFocus().getWindowTokeInputMethodManager.HIDE_NOT_ALWAYS);
}