开发者

How can I make sure my EditText always has focus?

开发者 https://www.devze.com 2023-03-12 12:41 出处:网络
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

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

精彩评论

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