Android软件盘的隐藏显示

来源:互联网 发布:soma剧情 知乎 编辑:程序博客网 时间:2024/06/10 05:26

//隐藏软键盘

public static void hideSoftKeyboard(View view) {        if (view == null)            return;        ((InputMethodManager) view.getContext().getSystemService(                Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(                view.getWindowToken(), 0);    }

显示软键盘

public static void showSoftKeyboard(View view) {        ((InputMethodManager) view.getContext().getSystemService(                Context.INPUT_METHOD_SERVICE)).showSoftInput(view,                InputMethodManager.SHOW_FORCED);    }
原创粉丝点击