1,初次进入隐藏软键盘(多种方式)
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
2,点击EditText获取焦点,但不弹出软键盘
public static void setDontShowSoftInputWhenFocused(EditText editText) {
try {
Method setShowSoftInputOnFocus = editText.getClass().getMethod("setShowSoftInputOnFocus", boolean.class);
setShowSoftInputOnFocus.setAccessible(true);
setShowSoftInputOnFocus.invoke(editText, false);
} catch (Exception e) {
e.printStackTrace();
}
}
引自 http://www.eoeandroid.com/forum.php?mod=viewthread&tid=318911