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,283 times
24
Zain
- 25,701
- 7
- 36
- 61
user1255273
- 289
- 1
- 8
3 Answers
13
You can try:
android:windowSoftInputMode="stateHidden"
for your activity in AndroidManifest.xml
Vyacheslav Shylkin
- 9,641
- 5
- 37
- 34
6
Add this two lines to you main layout.
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true"
MAC
- 15,659
- 8
- 53
- 95
-
1Works like a charm! +1 – Sindri Þór Dec 11 '15 at 13:34
3
Add in your layout definition (in xml file) this following options :
android:focusable="true" android:focusableInTouchMode="true"
n_benbourahla
- 69
- 2