开发者

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 Buttons. When I start the application, focus goes imm开发者_运维知识库ediately to the EditTexts 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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜