Android 关闭软键盘
更新:HHH   时间:2023-1-7


private void closeKeybord(){

View view = getWindow().peekDecorView();

        if (view != null) {

            InputMethodManager inputmanger = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);

            inputmanger.hideSoftInputFromWindow(view.getWindowToken(), 0);

        }

}


返回移动开发教程...