How to Set Focus to a TextView, using requestFocus, in XML
added in API Level 1Sets 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:
- setSelected(true) - Set Focus to a TextView, using Java
- android:state_selected - Set Focus to a TextView, using state_selected, in XML
http://stackoverflow.com/questions/8077755/edittext-request-focus