/**

*

* @MethodName:closeInputMethod

* @Description:关闭系统软键盘

* @throws

*/

public void closeInputMethod(){

try {

((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE))

.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(),

InputMethodManager.HIDE_NOT_ALWAYS);

} catch (Exception e) { }finally{ }

}

/**

*

* @MethodName:openInputMethod

* @Description:打开系统软键盘

* @throws

*/

public void openInputMethod(final EditText editText){

Timer timer = new Timer();

timer.schedule(new TimerTask() {

public void run() {

InputMethodManager inputManager = (InputMethodManager) editText

.getContext().getSystemService(

Context.INPUT_METHOD_SERVICE);

inputManager.showSoftInput(editText, 0);

}

}, 200);

}

最新文章

  1. python+selenium 浏览器的问题
  2. Divide Two Integers leetcode
  3. 使用Fragment应用放置后台很久,被系统回收,出现crash
  4. C#组态控件Iocomp应用案例
  5. unity vr sample on htc vive
  6. php 根据指定的键对多维数组进行排序
  7. css 内联元素inline 行框全解
  8. Spark源码编译
  9. Bootstrap学习笔记(三) 网格系统
  10. Chrome插件:网页截图
  11. Core love JavaScript
  12. ubuntu12.04下安装pptp_vpn服务器
  13. Less注释语法
  14. win10使用u盘装回win7
  15. gstreamer在Ubuntu下构建开发环境
  16. 059 SparkStream介绍
  17. Anaconda安装python(idea兼容)
  18. jQuery筛选--find(expr|obj|ele)和siblings([expr])
  19. maven 入门 (二)
  20. 元组类型&字典类型

热门文章

  1. SQL字符串分割解析
  2. 005-Go 操作PostgreSQL数据库
  3. gradle 配置及设置本地仓库
  4. MySQL auto_increment初始值设置
  5. AndroidStudio 中查看获取MD5和SHA1值以及如何查看手机应用信息以及读取*.db数据库里面数据
  6. 算法笔记_227:填写乘法算式(Java)
  7. 写一个function,清除字符串前后的空格。(兼容所有浏览器)
  8. C/C++与Java的区别
  9. Ulua_toLua_基本案例(八)_LuaAccessingArray
  10. 【DB2】SQL优化