requestFocus - Set Focus to a TextView, using requestFocus, in XML

How to Set Focus to a TextView, using requestFocus, in XML

added in API Level 1

Sets focus to a TextView using <requestFocus> in XML

1. Create an Android project, if you don't already have one.

2. Add a TextView in your main.xml file.

3. In the main.xml file, add the code below. * Make sure to change the highlighted text also.

  <TextView
        ...
       >

       <requestFocus /></TextView>

4. Compile and run!

Related Articles:
Resources:
http://stackoverflow.com/questions/8077755/edittext-request-focus