Android on-screen keyboard auto popping up Android on-screen keyboard auto popping up android android

Android on-screen keyboard auto popping up


You can use the following line of code in the activity's onCreate method to make sure the keyboard only pops up when a user clicks into an EditText

this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); 


<application android:icon="@drawable/icon" android:label="@string/app_name">    <activity android:name=".Main"              android:label="@string/app_name"              android:windowSoftInputMode="stateHidden"              >

This works for Android 3.0, 3.1, 3.2, 4.0 - Editor Used to Compile (Eclipse 3.7)

Place the 'windowSoftInputMode="stateHidden"' in your application's manifest XML file for EACH activity that you wish for the software keyboard to remain hidden in. This means the keyboard will not come up automatically and the user will have to 'click' on a text field to bring it up. I searched for almost an hour for something that worked so I thought I would share.


Add this in your AndroidManifest.xml :

android:windowSoftInputMode="stateHidden|adjustResize"

It works perfectly. :)