隐藏键盘的一种处理方法
通过调用系统服务来隐藏键盘的一种处理方法:
// 获取InputMethodManager实例InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);if (inputMethodManager != null) {// 获取当前Focus的ViewView currentFocus = getCurrentFocus();if (currentFocus != null) {// 隐藏键盘inputMethodManager.hideSoftInputFromWindow(currentFocus.getWindowToken(),InputMethodManager.HIDE_NOT_ALWAYS);}}
?
?