经验小结
2015-10-19 09:10
260 查看
1.在activity中用的隐藏软键盘的方法:
private void closeKeyBord(){
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
if(imm.isActive()&&getCurrentFocus()!=null){
if(getCurrentFocus().getWindowToken()!=null){
imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
}
}
}
private void closeKeyBord(){
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
if(imm.isActive()&&getCurrentFocus()!=null){
if(getCurrentFocus().getWindowToken()!=null){
imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
}
}
}
相关文章推荐
- java--通过socket和多线程进行多个客服端与服务器的简单通讯--基于tcp
- 面向对象,继承和接口的使用理解
- Linux GCC常用命令
- 深入理解Ajax原理
- typedef struct 小结
- 基础篇(二) Activity启动模式(launchMode)
- LUA中的and与or
- 获得当前时间 及其转换 localtime函数
- get-post请求
- Linux下高效编写Shell——shell特殊字符汇总
- jquery中注意事项
- Astro —— 华为开源的 SparkSQL on HBase
- Centos 6.4 python 2.6 升级到 2.7
- shiro,springmvc,mybatis,spring,(纯注解)maven(jar)
- Macosx Setdns
- python之模块csv之CSV文件的写入(按行写入)
- Lucene 工作原理
- 响应式网站中图片资源的简单切换
- ubuntu github 使用
- C++使用localtime函数需要注意的地方