On Android, I need a checkbox (or checkbox-like component) which can represent/control a flag for a number of selected items. There are 3 possibilities which I need to represent:
- Flag is set for all items.
- Flag is set for none of the items.
- Flag is set for some of the items.
I’m imagining something like this:

If the user selects the checkbox when it’s in state 3, it will switch to state 1. Thereafter, it will only toggle between states 1 & 2.
If you’re familiar with the checkboxes in the attributes section of the file properties dialog in Windows, that’s what I’m after.
Is there a native Android UI widget, or an existing open-source widget, which can do this?
I’m fairly confident I could do my own implementation, but I’d rather not re-invent the wheel!
I think you’d be best of with your own implementation. And it will be a fairly simple one, just use the: setOnCheckedChangeListener, here is a simple tutorial that just shows the use of this listeners, you will just implement changing your flags, and setting some of your checkboxes checkable when in the correct state.
http://developer.android.com/guide/topics/ui/controls/checkbox.html
hope it helps!