I have a TextView in my home screen widget. Can I use the following selector as the background of the TextView so the TextView can be highlighted when clicked? I know I can do it in Activity, but I am not sure about home screen widget. Thanks.
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@drawable/button_selected" /> <!-- pressed -->
<item android:state_pressed="false"
android:drawable="@drawable/beige_button" /> <!-- not pressed -->
<item android:drawable="@drawable/beige_button" /> <!-- default -->
</selector>
You can do this, if your TextView is clickable.