I've been trying to unselect my listView
selection, and have tried all the methods listed online, but it simply won't unselect:
<ListView
android:layout_marginTop="15dp"
android:layout_width="wrap_content"
android:layout_height="169dp"
android:id="@+id/listview"
android:choiceMode="singleChoice"
android:listSelector="#666666">
Now when I want to unselect it, I have the following code:
listView.setItemChecked(position, false);
listView.clearChoices();
listView.requestLayout();
listView.setSelected(false);
adapter.notifyDataSetChanged();
However, the selected item in the listView
stays grayed out in color (#666666) and doesn't unselect.
How can I unselect a selected item from my listView
?