0

How to remove the current drawable and go to old drawable state;

RadioButton radioButton = (RadioButton) findViewById(R.id.opt1);
radioButton.setButtonDrawable(R.drawable.ic_done);

For the next question, it should go to the old drawable.

So I have tried radioButton.setButtonDrawable(0) but it removed the drawable. Is there any way to getDefaultDrawable() according to Theme.AppCompat?

Bugs Happen
  • 2,169
  • 4
  • 33
  • 59
Asthme
  • 5,163
  • 6
  • 47
  • 65

1 Answers1

-1

You can do something like this:

Before changing background

RadioButton radioButton;
Drawable defaultRadioButtonBackground = radioButton.getBackground();

When you want to change back to default background

radioButton.setBackground(defaultRadioButtonBackground);
Bugs Happen
  • 2,169
  • 4
  • 33
  • 59
  • Compound Drawble does not have method called .getButtonDrawable(); – Asthme Mar 22 '15 at 16:22
  • its about radio button.button drawable is used for to user pressed the button or not .by default it will be round color – Asthme Mar 22 '15 at 16:30