I'm going to begin by saying that I have read in detail almost every question on SO that I can find related to custom checkable list items and selectors. Many of them have similar issues, but none of the answers solve my problem.

At a point in my app I present a custom list activity. When created, it retrieves a set of static data from the intent that called it and passes that data to it's custom array adapter. Each list item is a simple RelativeLayout that implements the Checkable interface. By default, if you click on one of the items, a new activity is shown which displays detailed information about the selected contact. However, if an item in the list is long-clicked, an ActionMode is started. Clicking on an item in the list at this point does not display the detail activity, it just sets the item to checked. Then, if the user chooses one of the action mode items, it performs the action on the checked item(s).

An important thing to understand is that in both selection 'modes', clicking on a list item sets it to checked.

All of what I described above works perfectly. My only problem has to do with the backgrounds of the list items not being highlighted when they are set to checked, even using the default selector.

What I want to do, is have two selectors: one for each selection mode. In the first, the background doesn't change when an item is checked, and in the second it does. I have tried implementing custom selectors, but even in those state_checked is ignored! Other parts of the selector work fine, but not state_checked.

My implementation of CheckableListItem incorporates ideas from a lot of different examples, so if I'm doing something wrong, or if there is a better way let me know!

Note: An interesting point is that if I set the background of the list items

Edit
Report