开发者

Change what item has focus on startup. Remove focus from EditText

开发者 https://www.devze.com 2023-02-13 00:25 出处:网络
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 bo

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

精彩评论

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