I have a ListView subclass that I allow selections on when the context action bar (CAB) is active. The CAB is set as a callback to the onItemLongClick event:
This has been logged as an AOSP bug, but marked as obsolete for whatever reason.
Normally you would expect this to work:
getListView().clearChoices();
getListView().setChoiceMode(ListView.CHOICE_MODE_NONE);
Unfortunately it does not. Deferring setting choice mode to none in the next layout pass would work:
getListView().clearChoices();
getListView().post(new Runnable() {
@Override
public void run() {
getListView().setChoiceMode(ListView.CHOICE_MODE_NONE);
}
});