So I\'m setting a button\'s background doing this:
b.setBackgroundResource(R.drawable.custom_button1);
How do I programmatically set it bac
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.
first get the default background of Button b;
using
Drawable d = b.getBackground();
then set another background of your choice
b.setBackgroundResource(R.drawable.custom_button1);
if you need default background again use this
b.setBackgroundDrawable(d);
Use this
b.tr.setBackgroundDrawable(null);
I did it by
this.setBackgroundResource(android.R.drawable.btn_default);
Have you tried this?
android.R.drawable.btn_default;
try
button.setBackgroundResourses(R.drawable.yourimage);
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