本文介绍了隐藏软键盘对话框驳回后,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想隐藏软键盘之后AlertDialog辞退,但它仍然是可见的。这是我的code:

警报=新AlertDialog.Builder(MyActivity.this);IMM =(InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);alert.setOnDismissListener(新DialogInterface.OnDismissListener(){    @覆盖    公共无效onDismiss(DialogInterface对话){        imm.hideSoftInputFromWindow(getCurrentFocus()getWindowToken(),0);    }});

解决方案

您可以在这里找到一个解决方案:

http://www.workingfromhere.com/blog/2011/04/27/close-hide-the-android-soft-keyboard/

或位置:

关闭/隐藏Android的软键盘

I want to hide soft keyboard after AlertDialog dismiss, but it's still visible. Here is my code:

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);
    }
});
解决方案

You can find a solution here:

http://www.workingfromhere.com/blog/2011/04/27/close-hide-the-android-soft-keyboard/

OR here:

Close/hide the Android Soft Keyboard

这篇关于隐藏软键盘对话框驳回后,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 18:42