android – Do not open keyboard automatically when entering screen with EditText

Question:

I have a screen with an EditText there, whenever I enter it, the keyboard opens. I wanted it to only open the keyboard when I clicked on it.

I tried this but the keyboard is not opening at all:

mItemDescriptionTextView.setFocusable(false);

Answer:

You need to add android:windowSoftInputMode="stateHidden" inside your AndroidManifest.xml :

<activity 
    android:name=".SuaActivity"
    android:windowSoftInputMode="stateHidden"/>

This flag will hide the keyboard when the user enters your Activity (even if the EditText has focus).

Scroll to Top