开发者

How can I make sure my EditText always has focus?

Whenever an activity starts, I want to make sure my EditText has focus and has the cursor inside. Basically I want to开发者_JAVA百科 make sure the keyboard is up.


In the EditText tag in your xml layout, add the tag

<requestFocus />

You may also do the programatically by calling the method. editText.requestFocus.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜