0

I call the function to open the dialog. Dialog boxes have two EditText. When I open the dialog box, the keyboard automatically pops up. How can I disable this behavior? I only need to open the keyboard when the EditText receives a touch event.

2Dee
  • 8,609
  • 7
  • 42
  • 53
sabish
  • 31
  • 1
  • 8
  • http://stackoverflow.com/questions/1555109/stop-edittext-from-gaining-focus-at-activity-startup?rq=1 – SatyaTNV Jul 13 '15 at 13:49
  • possible duplicate of [Can stop EditText auto-focus?](http://stackoverflow.com/questions/11732545/can-stop-edittext-auto-focus) – Roberto Tellez Ibarra Jul 13 '15 at 13:52
  • Check these links http://stackoverflow.com/questions/1555109/stop-edittext-from-gaining-focus-at-activity-startup http://stackoverflow.com/questions/11732545/can-stop-edittext-auto-focus http://stackoverflow.com/questions/18295802/how-to-make-edittext-not-focused-when-creating-activity – Roberto Tellez Ibarra Jul 13 '15 at 13:52

2 Answers2

1

on your onCreate() method

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

If you want all your activity use soft keyboard use this in your manifest file for your all activities

<activity
    android:configChanges="keyboardHidden|orientation"
    android:windowSoftInputMode="stateHidden" />
AliNadi
  • 500
  • 4
  • 12
0

Add this lines in your Androidmanifest.xml file android:windowSoftInputMode="stateHidden"

Example:-

<activity
            android:name=".Registration_Screen"
            android:windowSoftInputMode="stateHidden" >
        </activity>
Bala Saikrupa Puram
  • 721
  • 1
  • 7
  • 28