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(安卓)Activity的生命周期管理
  2. Android中Service类onStartCommand的返回值问题
  3. Android(安卓)Phone进程启动过程
  4. Android(安卓)Log
  5. android tabhost
  6. android手势滑动——左右滑动效果实现
  7. android打开前置摄像头和后置摄像头
  8. android camera [一] Camera open process
  9. Android休眠唤醒驱动流程分析

随机推荐

  1. Android(安卓)开发简介-系统架构
  2. 安卓开发一步到位
  3. 独立android开发者开发app如何盈利
  4. Android当中的MVP模式(三)基于分页列表的封
  5. Android高手进阶教程(二十)之---Android
  6. android:layout_gravity 和 android:grav
  7. Android数据库升级
  8. Android(安卓)多线程编程:IntentService &
  9. 7款Android开发者常用的Android(安卓)UI
  10. Android应用程序消息处理机制(Looper、Han