Change what item has focus on startup. Remove focus from EditText
I have a LinearLayout
and an associated Activity
. In my view there is an EditText
's box and a bunch of Button
s. When I start the application, focus goes imm开发者_运维知识库ediately to the EditText
s box and the soft keyboard comes up. Is there a way to avoid this so that it just comes up with nothing selected and no soft keyboard popping up? I have tried findViewById().clearFocus()
and requestFocus()
on different views, but nothing seems to work.
Change your Activity settings in manifest like below:
<activity
android:name=".MyActivity"
android:windowSoftInputMode="stateHidden">
</activity>
精彩评论