android:state_selected - Set Focus to a TextView, using state_selected, in XML

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

added in API Level 1

Sets focus to a TextView using XML

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

2. In the main.xml file, add the code below.

  <TextView
        ...
       android:state_selected = "true"
  />

3. Compile and run!

Related Articles:
Resources:
http://developer.android.com/reference/android/R.attr.html#state_selected