android 完美隐藏软键盘

    public void hideSoftInput(Activity activity) {
        // 关闭软键盘
        if (activity.getCurrentFocus() != null) {
            if (activity.getCurrentFocus().getWindowToken() != null) {
                InputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
                inputMethodManager.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(),InputMethodManager.HIDE_NOT_ALWAYS);
            }
        }
    }


上一篇:关于OleDB连接Excel的Extended Properties(扩展属性)HDR=YES; IMEX=2个人理解心得


下一篇:好程序员web前端详解HTML5中download属性的应用