How to get a Button's background back to default (programmatically)?

Viewed 24911

So I'm setting a button's background doing this:

b.setBackgroundResource(R.drawable.custom_button1);

How do I programmatically set it back to the default (boring grey) Android button? Is there a R.android.boring_grey resource identifier I can reference without recreating those states myself? Couldn't seem to find it. Maybe my Googling skills are failing me.

Oh and by the way I tried this:

   b.setBackgroundResource(0);

And the button actually disappeared (blended with black background?).

6 Answers

Drawable for "modern" button in XML is @android:drawable/btn_default_material
It does not exist in android.R.drawable for some reason.

EDIT: it's private, so don't use it.

Related