The context: I want to have a ListView that wouldn’t receive focus (e.g. won’t highlight row when user touches it). Yet each row widget has it’s own OnClickListener. Here’s what I specify in layout xml:
android:choiceMode='none' android:focusableInTouchMode='false' android:focusable='false'
The ListView still behaves exactly the same. Could someone please explain
- The interrelation between the three
- What’s the right way to create a ListView that doesn’t receive focus?
TIA.
The list receiving focus is different than the selected row not highlighting. The list gets focus whenever a user is in it. The best a ListView can do is report an
intfor whatever the user has selected. I’m not sure how each row widget has it’s own ClickListener. There are no row widgets that I am aware of. TheonListItemClickbelongs to the ListView.I havent been able to figure it out yet, but between
android:listSelectorandandroid:backgroundand adjusting the alpha channels I figure there would be a way to make a selection look just like a non-selected row.android:listSelector='#8fff'makes it so just the foreground changes on selection.It seems like android chooses the non-selected foreground on its own, which is making this hard. I hope this helps.