I have an Edittext with android:windowSoftInputMode="stateVisible"
in Manifest. Now the keyboard will be shown when I start the activity. How to hide it? I cannot use android:windowSoftInputMode="stateHidden
because when keyboard is visible then minimize the app and resume it the keyboard should be visible.
I tried with
InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
but it did not work.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…