博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Android中软键盘(输入法)收起的方法
阅读量:523 次
发布时间:2019-03-08

本文共 595 字,大约阅读时间需要 1 分钟。

Android中隐藏软键盘的方法,下面是个工具类,直接调用方法即可

package com.Yhsh.util;import android.app.Activity;import android.content.Context;import android.view.inputmethod.InputMethodManager;/** * /** * 创 建 者:下一页5(轻飞扬) * 创建时间:2018/4/18.11:25 * 关于键盘方法的所有工具类 */public class KeyboardUtils {    /**     * 隐藏键盘的方法     *     * @param context     */    public static void hideKeyboard(Activity context) {        InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);        // 隐藏软键盘        imm.hideSoftInputFromWindow(context.getWindow().getDecorView().getWindowToken(), 0);    }}

 

转载地址:http://yrmnz.baihongyu.com/

你可能感兴趣的文章