强制关闭软键盘
/** * 强制关闭软键盘 */ public static void hidenKeyboars(Context context, View view) { InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(view.getWindowToken(), 0); }
调用示例
View v2 = findViewById(R.id.base_title_right_camera); CommandTools.hidenKeyboars(SenSmsMainActivity.this, v2);