来源: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里面WebView加载HTML里面点击按钮调我Android方法
  2. Android Stdio实现点击按钮出现图片
  3. Android如何设置圆角按钮
  4. Android 4.0源码编译错误
  5. Android 源码阅读之SMS
  6. 【android-tips】android程序执行adb shell命令(实例源码)
  7. android 模拟按钮点击
  8. Android 点击按钮,文字改变颜色

随机推荐

  1. Android中Radio单选按钮操作
  2. Android之通过category跳转到指定的Activ
  3. Android:FontMetrics详解
  4. Android对话框实例-注册对话框
  5. 【android】Getting bitmap from a view
  6. android property
  7. META-INF Files - Digests, Signature an
  8. android异步加载图片
  9. Android(安卓)工具类
  10. Android(安卓)studio 53 文件下载