My listitem.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" style="@style/f_w" android:layout_height="60sp" android:padding="0sp">
<TextView android:id="@+id/con_name"
android:textSize="16sp"
style="@style/w_w" />
<TextView android:id="@+id/con_time"
android:textSize="13sp"
android:textColor="#565"
style="@style/w_w" />
</RelativeLayout>
So, I want to specify textColor of my textviews on item pressed. I’m using custom listview via baseadapter.
Create a selector for your TextView text color.
res/color/list_item_text_color_selector.xml
res/layout/listitem.xml
If you want this to apply to both TextViews, you can add it in @style/w_w and remove the android:textColor part from your TextView.