0

Hi guys i am new to android. I have an activity which has an edittext and a continue button at the bottom of the page. when the activity is running the user can choose to type something in the edittext or just press the continue button without using the edittext. the problem i have is when the activity starts the edittext automatically opens up the keyboard which covers my continue button. How do i make the edittext inactive unless selected by the user so that the user can have the choice not to use the edittext and just press the continue button?

user2608169
  • 115
  • 3
  • 9
  • Check this http://stackoverflow.com/questions/5550429/edittext-android-automatic-focus – nio Nov 04 '13 at 09:48
  • possible duplicate of [Android on-screen keyboard auto popping up](http://stackoverflow.com/questions/2496901/android-on-screen-keyboard-auto-popping-up) – Devrim Nov 04 '13 at 09:49
  • or this: http://stackoverflow.com/questions/1109022/close-hide-the-android-soft-keyboard – Timuçin Nov 04 '13 at 09:49

1 Answers1

3

In manifest file of the Android project, add the following attribute to your activity declaration

<activity
     ...
     android:windowSoftInputMode="stateHidden"
     ... />

This will prevent the auto-opening of keyboard and will only open when focus is moved to EditView.

You can read more on this here.

Hope this helped.

jagmohan
  • 2,012
  • 1
  • 26
  • 38