Every time I open my android app, it automatically focuses the EditText
box and the soft keyboard opens up. Is there a way to focus something else on start up so the keyboard doesn't show right away?
Asked
Active
Viewed 2,310 times
27

Zain
- 37,492
- 7
- 60
- 84

user1255273
- 319
- 2
- 8
3 Answers
13
You can try:
android:windowSoftInputMode="stateHidden"
for your activity in AndroidManifest.xml

Vyacheslav Shylkin
- 9,741
- 5
- 39
- 34
6
Add this two lines to you main layout.
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true"

MAC
- 15,799
- 8
- 54
- 95
3
Add in your layout definition (in xml file) this following options :
android:focusable="true" android:focusableInTouchMode="true"

n_benbourahla
- 69
- 3