I have an Activity with single Fragment on it. There is one EditText on the fragment.
The keyboard is popping up as soon the fragment is shown, however I managed to block it setting in the manifest android:windowSoftInputMode="stateHidden"
However, there also is a button, which opens a dialog with another EditText.
I have a method that automatically closes the keyboard on dialog dismiss.
public static void closeInput(final View caller) { caller.post(new Runnable() { @Override public void run() { InputMethodManager imm = (InputMethodManager) caller.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(caller.getWindowToken(), InputMethodManager.HIDE_IMPLICIT_ONLY); } }); } The method is not a pretty hack and there is something wrong about it. Dialog's EditText has inputType="numberDecimal". The closeInput() seems to be not closing the keyboard, only changing it to the default alphabetical state.
What is going on here?
onResume()of your fragment?