Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Edittext android automatic focus

I have an issue when the activity starts, android automatically places focus on the first edittext. How do I prevent android from doing that?

like image 349
Hades Avatar asked Apr 05 '11 10:04

Hades


2 Answers

Have a look here

Or you could just hide the keyboard, focus remains on the EditText upon starting the activity:

android:windowSoftInputMode="stateHidden"
like image 122
SteD Avatar answered Sep 28 '22 08:09

SteD


use setFocusable (boolean focusable) to prevent. http://developer.android.com/reference/android/view/View.html#setFocusable(boolean)

like image 35
Ajay Singh Avatar answered Sep 28 '22 09:09

Ajay Singh