1

I have three screens in my application, and these have 3 editTexts each screen. My problem is that , when ever these activities are launched, defaultly cursor is going to the first edittext and keyboard is popping up .

what i want is , when the user clicks at the editbox, then only keyboard should popup.

Thanks in Advance,

Sudheer

user1746619
  • 83
  • 1
  • 2
  • 9

4 Answers4

2

First test in your xml file that you may have this line in your edit text <requestFocus /> remove it, and here is some example which can help you Example link

<EditText
   android:id="@+id/name"
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   >

   <-- remove this line /// <requestFocus /> 
</EditText>

also add this in your activity

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
Community
  • 1
  • 1
Amitabh Sarkar
  • 1,281
  • 1
  • 13
  • 26
0

At your layout.xml, remove this line (at the bottom of your EditText):

 <requestFocus />
Bigflow
  • 3,616
  • 5
  • 29
  • 52
0

Try this, Add windowSoftInputMode in all activites it will avoid keyboard is popping up . when you touch EditText that time only appear

 android:windowSoftInputMode="stateHidden|adjustPan"
MuraliGanesan
  • 3,233
  • 2
  • 16
  • 22
0

Put this code in your oncreate() method.

@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    getWindow().setSoftInputMode(
                WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
        }
Hardik Joshi
  • 9,477
  • 12
  • 61
  • 113