问题
Everytime 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 doesnt show right away?
回答1:
You can try:
android:windowSoftInputMode="stateHidden"
for your activity in AndroidManifest.xml
回答2:
Add this two lines to you main layout.
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true"
回答3:
Add in your layout definition (in xml file) this following options :
android:focusable="true" android:focusableInTouchMode="true"
来源:https://stackoverflow.com/questions/11542797/dont-want-soft-keyboard-to-automatically-show-on-launch-android