android 回收软键盘
2017-09-14 本文已影响67人
苏坡乔
private void hideKeyboard() {
View viewFocus = this.getCurrentFocus();
if (viewFocus != null) {
InputMethodManager imManager = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imManager.hideSoftInputFromWindow(viewFocus.getWindowToken(), 0);
}
}