1.工具类源码。

package com.mobile.netutils;import android.content.Context;import android.view.View;import android.view.inputmethod.InputMethodManager;/** * Created by Administrator on 2018/8/6 0006. */public class NetHideInputUtil {    /**     * 强制隐藏输入法键盘     *     * @param context Context     * @param view    EditText     */    public static void hideInput(Context context, View view) {        InputMethodManager inputMethodManager = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);        inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0);    }}

2.调用的时候

EditText edtName;//记得初始化NetHideInputUtil.hideInput(this, edtName);

更多相关文章

  1. android 输入法弹出 标题栏不被顶出去
  2. android webkit 初始化流程
  3. android 输入法弹出键盘把listview顶上去,保留顶部标题栏位置不动
  4. Android输入法遮挡了输入框,使用android:fitsSystemWindows="true
  5. Android 输入法键盘和activity页面遮挡问题解决
  6. Android Initialization Process ---- Android 初始化过程
  7. android 修改谷歌拼音输入法全屏时的高度

随机推荐

  1. Android添加ButterKnife时报错Error:(2,
  2. 编译android源码
  3. Android事件总线 浅谈 EventBus
  4. 2018 Android(安卓)框架汇总(转)
  5. Android:如何显示网络图片
  6. Android第四十二期 - 关于微信手势退出Ac
  7. 使用kotlin开发android
  8. Android(安卓)中数据库查询方法 query()
  9. AndroidPN测试(Android(安卓)Push Notific
  10. Ubuntu下配置Android