I have achieved something similar for particular items within my ListView
in this question.
However, now, I want the user to be able to click on items, which will essentially highlight any item the user has tapped. I keep a list of the tapped items in my application, and should be able to reference this from the ViewBinder
when scrolling occurs, however, since I am never adapting anything to the LinearLayout
that makes up the ListView
itself, I am not sure how to get the LinearLayout
object in order to properly set its background color.
I need to be able to do this, because as you may know, when scrolling, Android re-uses the list items, which is fine unless you are changing formatting (coloring, etc.) of individual list items. In that case, you end up with list items that are colored/formatted incorrectly. I am using a ViewBinder
to solve the issue when it comes to the TextViews
within my list items, but do not know how to do something similar for the background of the ListView
itself.