Android強制非表示入力キーボード
458 ワード
Android開発では、キーボードを隠す必要がある場合がありますが、以下に入力方式のキーボードを強制的に隠す方法を示します.
/**
*
*
* @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);
}