Eyal
Eyal

Reputation: 1709

Writing android:button programmatically


I would like to use the RadioButton's property - android:button="@drawable/abc" - programmatically.
How do I write this in Java?

Upvotes: 0

Views: 187

Answers (1)

b00n12
b00n12

Reputation: 1428

Try this

radioButton.setButtonDrawable(new StateListDrawable());

and perhaps also have a look at this question:

programmatically set custom drawables for radio buttons

Upvotes: 1

Related Questions