Android Button drawableLeft - how to hardcode it (no xml)
Question
How can I add a "drawable left" icon to a button object?
I mean something like this:
Button button = new Button();
button.setDrawableLeft(R.drawable...);
Solution
Use Button.setCompoundDrawablesWithIntrinsicBounds(..)
which relates to android:drawableLeft attribute.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow