本文共 1735 字,大约阅读时间需要 5 分钟。
InputMethodManager inputMethodManager = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); // 接受软键盘输入的编辑文本或其它视图 imm.showSoftInput(submitBt,InputMethodManager.SHOW_FORCED);
InputMethodManager inputMethodManager = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(OpeListActivity.this.getCurrentFocus().getWindowToken() ,InputMethodManager.HIDE_NOT_ALWAYS); //接受软键盘输入的编辑文本或其它视图 inputMethodManager.showSoftInput(submitBt,InputMethodManager.SHOW_FORCED);
InputMethodManager m=(InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); m.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); boolean isOpen=imm.isActive(); //isOpen若返回true,则表示输入法打开
/** * 判断软键盘是否打开 * @param activity * @return */ public static boolean isSoftShowing(Activity activity) { //获取当前屏幕内容的高度 int screenHeight = activity.getWindow().getDecorView().getHeight(); //获取View可见区域的bottom Rect rect = new Rect(); activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(rect); return screenHeight - rect.bottom != 0; }
—————————————————————————————————————————————————–
下载地址:
https://item.taobao.com/item.htm?id=562739965822
01.高级架构师四十二个阶段高
02.Java高级系统培训架构课程148课时 03.Java高级互联网架构师课程 04.Java互联网架构Netty、Nio、Mina等-视频教程 05.Java高级架构设计2016整理-视频教程 06.架构师基础、高级片 07.Java架构师必修linux运维系列课程 08.Java高级系统培训架构课程116课时 + hadoop系列教程,java设计模式与数据结构, Spring Cloud微服务, SpringBoot入门 —————————————————————————————————————————————————–转载地址:http://rehvf.baihongyu.com/