how to change font color in selected/focused ListView items?

Neither of these are possible answers when your ListView is compromised of a layout that has multiple views. You need to set your child views to:

android:duplicateParentState="true"

Now you can use the methods others have described above to declare your TextViews’ colors using a selector such as:

android:textColor="@drawable/my_row_selector"

and I’m sure you’re aware, but the selector can be as simple as:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true" android:color="@color/white" />
    <item android:color="@color/black" />
</selector>

As you can see, @color values are allowed. Hope this helps.

Also – android:state_pressed is used in conjunction with the AdapterView.OnItemClickListener.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)