public static void hideKeyboard(Context context) { // 隐藏软键盘 try { InputMethodManager imm = ((InputMethodManager) context .getSystemService(context.INPUT_METHOD_SERVICE)); imm.hideSoftInputFromWindow(((Activity) context).getCurrentFocus() .getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); } catch (Exception e) { } }
时间: 2024-10-17 03:38:55