Android 隐藏软键盘功能的实现


                Activity context = (Activity) mContext;
                final View v = context.getWindow().peekDecorView();
                if (v != null && v.getWindowToken() != null) {
                    InputMethodManager imm = (InputMethodManager) context.getSystemService(context.INPUT_METHOD_SERVICE);
                    imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
                }
posted @ 2018-01-12 15:49  趣学程序  阅读(132)  评论(0编辑  收藏  举报