I'm trying to add a CAB (Contextual Action Bar) to a ListView in my app and everything is going well except for one thing. When I initially added the CAB the background color didn't change when I long pressed it although it was selected. My sollution to this was to override onItemCheckedStateChanged and set the background color there. My problem is that when I try to set the background color to what it was earlier I can't. The ListView background appears to be faded which means I can't select a color that blends in with the background. How are you guys doing this? Here's my code:
@Override
public void onItemCheckedStateChanged(ActionMode mode, int position,
long id, boolean checked) {
if (checked) {
//#6DCAEC is a type of Holo Blue that I want.
listView.getChildAt(position).setBackgroundColor(Color.parseColor("#6DCAEC"));
} else {
//#f1f1f1 was the closest I could get to the background put it still seems out of place
listView.getChildAt(position).setBackgroundColor(Color.parseColor("f1f1f1"));
}
}