来源:Android 源码 /packages/apps/QuickSearchBox/.../SearchActivity.java

1. Import

import android.view.inputmethod.InputMethodManager;

2. HOWTO

/**

* Hides the input method.

*/

protected void hideInputMethod() {

InputMethodManager imm = (InputMethodManager) getContext().getSystemService(INPUT_METHOD_SERVICE);

if (imm != null) {

imm.hideSoftInputFromWindow(mQueryTextView.getWindowToken(), 0);

}

}

protected void showInputMethodForQuery() {

InputMethodManager imm = (InputMethodManager) getContext().getSystemService(INPUT_METHOD_SERVICE);

if (imm != null) {

imm.showSoftInput(mQueryTextView, 0);

}

}

3. More information of others

默认弹出和按钮点击

http://www.eoeandroid.com/thread-13373-1-1.html

更多相关文章

  1. Android如何设置圆角按钮
  2. Android(安卓)统计图表引擎 AChartEngine(三) - 示例源码折线图
  3. Android(安卓)Stdio实现点击按钮出现图片
  4. Android的AlertDialog的6种使用情景
  5. Android里面WebView加载HTML里面点击按钮调我Android方法
  6. Android(安卓)点击按钮,文字改变颜色
  7. Android中的MD5加密
  8. 【android-tips】android程序执行adb shell命令(实例源码)
  9. Android(安卓)4.0源码编译错误

随机推荐

  1. android:launchMode="singleTask" 与 onN
  2. git 获取android source
  3. Android笔记1
  4. Android(安卓)创建自定义View 实现TopBar
  5. Android笔记 - 常见错误解决方法 | Andro
  6. Android启动脚本init.rc(2)
  7. Android(安卓)消息传递机制分析
  8. 详解 Android(安卓)的 Activity 组件
  9. Android(安卓)中如何获取editText文本信
  10. Android(安卓)- menu 相关