1. //隐藏软键盘 ((InputMethodManager)getSystemService(INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(WidgetSearchActivity.this.getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); //显示软键盘,控件ID可以是EditText,TextView ((InputMethodManager)getSystemService(INPUT_METHOD_SERVICE)).showSoftInput(控件ID, 0);   

   if (imm.isActive()) {   //如果开启与关闭互换    
      imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT,InputMethodManager.HIDE_NOT_ALWAYS);
   }//关闭软键盘,开启方法相同,这个方法是切换开启与关闭状态的

更多相关文章

  1. android 线程超时的例子
  2. Android之常用功能代码
  3. Android(Java):滑动删除实现——重写onTouch
  4. android:Handler开启线程定时循环
  5. Android(安卓)打开闪光灯(手电筒)
  6. Android(安卓)响应键盘移动图标
  7. Android动态关闭mainfest中的receiver
  8. Android(安卓)P 限制级API调用弹窗关闭
  9. Android--WindowManager.LayoutParams(上)

随机推荐

  1. Android无法System.out.println出null
  2. android实战
  3. Android动画循环弹动cycleInterpolator
  4. android批量插入数据效率对比
  5. Android - adb : logcat / shell / app_p
  6. Android中Activity共享变量的另一方法:App
  7. Android实现底部弹出按钮菜单升级版
  8. fastboot 详解
  9. Android系统开发小问题-启动过程中android
  10. android之有返回结果跳转intent