I have listview with custom adapter. In each row i have 2 textviews and a button. I want when I click on an item to highlight it and to stay highlighted until i click another item. I tried to do it with list selector but didn't succeed. Then I tried to do it like this:
public void onClick(View v) {
ListView lvItems = context.lvLists;
for (int i=0; i < lvItems.getChildCount(); i++)
{
lvItems.getChildAt(i).setBackgroundColor(Color.BLACK);
}
v.setBackgroundColor(Color.parseColor("#555555"));
This is the onclick of each row of the listview. It works but I saw that when I scroll down there are more items selected (which I didn't select). Solution for this?