我想在 AlertDialog 关闭后隐藏软键盘,但它仍然可见。这是我的代码:
alert = new AlertDialog.Builder(MyActivity.this);
imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
alert.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
}
});