开发者

android Editext setText should not focused and blinking cursor

开发者 https://www.devze.com 2022-12-21 18:44 出处:网络
in my activity 1 editext field and 2 check boxes i do setText(\"default text\") in oncreate. when my application lods display default text also blinking cursor inside the text field also shows oran

in my activity

1 editext field and 2 check boxes

i do setText("default text") in oncreate.

when my application lods display default text also blinking cursor inside the text field also shows orange border tells it is having focus.

i don't want to be text field focus on create instead it should focus on some where else i di开发者_StackOverflow社区d request focus on rest of the checkboxes but it didn't work out textfield still having focus.


i fixed this problem myself

View okBtn =findViewById(R.id.tlSettingOK);
            okBtn.setFocusableInTouchMode(true);
            okBtn.requestFocusFromTouch();
0

精彩评论

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