Hide soft keyboard on application load

Esben Andersen picture Esben Andersen · May 25, 2011 · Viewed 30.5k times · Source

I have an application with an EditText element on the main view. This means that when my application is loaded the soft keyboard appears per default.

I would like to be able to hide the keyboard on load, so it does not show until i tap on the EditText view.

How do i manage this?

Answer

inazaruk picture inazaruk · May 25, 2011

In your AndroidManifest.xml:

<activity android:name="com.your.package.ActivityName"
          android:windowSoftInputMode="stateHidden"  />

More details about windowSoftInputMode can be found here.

This setting will hide soft keyboard when user enters new Activity (even if EditText control gains the focus). Soft keyboard will be shown only when user clicks the edit box control.