I am having 1 list view contactslist. I wrote the code for highlighting the selected item in the ListView. It is working. When I click on 1 item it is highlighting that item but the problem is if I click on other item it is highlighting that too. I want to highlight the selected item only. The previous selection will have to gone when I click on another item.
arg1.setBackgroundResource(R.drawable.highlighter);
This is the code in the click listener using to highlight the selected item. plz help me.
Update
I'm setting the background of the rows in the adapter:
public int[] colors = new int[]{0xFFedf5ff, 0xFFFFFFFF};
public int colorPos;
[...]
colorPos = position % colors.length;
row.setBackgroundColor(colors[colorPos]);