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?).
first get the default background of
Button b;
usingthen set another background of your choice
if you need default background again use this
Have you tried this?
try
it will set the default background of buttons. and you can read more default properties of android widgets from given link: https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/styles.xml
I did it by
Use this