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.
Add the following text to your xml file.
Put this code your java file and pass the argument for object on edittext,
You can set config on AndroidManifest.xml
Example:
Put this in the manifest inside the Activity tag
This is what I did: