您的位置:首页 > 其它

隐藏输入法

2016-02-29 22:11 204 查看
点击别处隐藏输入法的方法

@Override

public boolean onTouchEvent(MotionEvent event) {

if (event.getAction() == MotionEvent.ACTION_DOWN) {

if (this.getCurrentFocus() != null) {

if (this.getCurrentFocus().getWindowToken() != null) {

InputMethodManager im =(InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);

im.hideSoftInputFromWindow(this.getCurrentFocus().getWindowToken(),

InputMethodManager.HIDE_NOT_ALWAYS);

}

}

}

return super.onTouchEvent(event);

}

参考文献:

1、http://www.cnblogs.com/changjl/p/4175539.html

2、/article/7418498.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: