I am looking to set the selected item in getView()
, is working however every item in my list is selected. I have tested with toasts and the correct is displayed so the condition is working. The condition checks to see if an entry from a DB for the specific item is set to true (thus being selected).
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
if(isItemSelected.equals("true")){
listviewTitles.setBackgroundColor(0xAAAAFFFF);
}
else if (isItemSelected.equals("false")){
// Default color
}
}
You should update your background colors every conditions like below;