Android: disabling highlight on listView click

John Moffitt picture John Moffitt · May 25, 2010 · Viewed 176.2k times · Source

I want to disable the orange highlight that occurs when touching a listView row. So far in my xml I have tried the following:

android:focusable="false"
android:focusableInTouchMode="false"
android:clickable="false"

More information: I want there to be zero difference when a user touches the screen on this listView object.

Answer

RoflcoptrException picture RoflcoptrException · May 25, 2010

Add this to your xml:

android:listSelector="@android:color/transparent"

And for the problem this may work (I'm not sure and I don't know if there are better solutions):

You could apply a ColorStateList to your TextView.