package com.simon.util;
import android.app.Activity;
import android.content.Context;
import android.view.inputmethod.InputMethodManager;
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);
}
}