I have a group of FrameLayout which I want to be checkable/selectable,
That is, after a click I would like the FrameLayout to display as
Graeme's solution doesn't worked from me under Android 4.0.3 (and I suppose it won't work under 4.0 too). Instead you can change state_checked to state_activated:
and use setActivated inside your setChecked:
@Override
public void setChecked(boolean checked) {
mChecked = checked;
setActivated(checked);
}
and that is all. Implementing onCreateDrawableState isn't required here.