3

The keyboard pops up wherever there's an EditText item. I wan't to disable this popup from occurring automatically and only want the keyboard to appear when the user manually sets focus on the EditText field. I have added the following in my Manifest file but it doesn't appear to work:

<activity android:name=".AccountActivity" android:label="yourtime" android:windowSoftInputMode="adjustResize|stateHidden"></activity>
Ahmed Mujtaba
  • 2,110
  • 5
  • 36
  • 67

2 Answers2

3

As I already wrote in the comment use the getWindow() method of your host-activity to set the SOFT_INPUT_STATE_AL‌​WAYS_HIDDEN flag. There is no need to invoke anything on an EditText when you want to disable the up-popping keyboard generally in this specific activity.

Martin Pfeffer
  • 12,471
  • 9
  • 59
  • 68
0

You can also set this in the manifest file. For each activity, add the following attribute.

android:windowSoftInputMode="stateHidden"
AndreP
  • 31
  • 1
  • 5