点击空白,键盘退出
时间:2014-08-12 18:39:34
收藏:0
阅读:307
@Override public boolean onTouchEvent(MotionEvent event) { InputMethodManager manager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); if (event.getAction() == MotionEvent.ACTION_DOWN) { if (getCurrentFocus() != null && getCurrentFocus().getWindowToken() != null) { manager.hideSoftInputFromWindow(getCurrentFocus() .getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); } } return super.onTouchEvent(event); }
原文:http://www.cnblogs.com/weixiong-wang/p/3907958.html
评论(0)