I am trying to remove an ImageButton\'s background in only the default state. I\'d like the pressed and selected states to behave as usual so that they look correct on diffe
StateListDrawable replace = new StateListDrawable();
Drawable old = getBackground();
replace.addState(FOCUSED_STATE_SET, old);
replace.addState(SELECTED_STATE_SET, old);
replace.addState(PRESSED_STATE_SET, old);
replace.addState(StateSet.WILD_CARD, new ColorDrawable(Color.TRANSPARENT));
if (Build.VERSION.SDK_INT >= 16) {
setBackground(replace);
} else {
setBackgroundDrawable(replace);
}