(java/xml for android 2.1 or higher)
I'm creating button using style:
<style name="MainButton">
<item name="android:textColor">#000000</item>
<item name="android:text">test</item>
<item name="android:drawableRight">@drawable/ic_launcher</item>
<item name="android:drawablePadding">10dip</item>
<item name="android:paddingLeft">10dip</item>
</style>
I know that I can change text (from my java code), for example like this:
Button but = (Button)findViewById(R.id.button2);
but.setText(Html.fromHtml("<b>" + "title" + "</b>" + "<br />" +
"<small>" + "description" + "</small>" + "<br />" +
"<small>" + "DateAdded" + "</small>"));
And it looks very well, but How can I change my drawable object inside of that button from my java code?
I dont want to use "button.setBackgroundResource();" method.
Any ideas? :>