Sheehan Alam
Sheehan Alam

Reputation: 60909

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 make sure the keyboard is up.

Upvotes: 0

Views: 972

Answers (1)

achie
achie

Reputation: 4746

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

<requestFocus />

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

Upvotes: 1

Related Questions