I want to add an icon to a Button that I created from Java, after hours I didn't find a solution yet...
I have something like this:
Button button = new Button(context);
And I'd like to have something like this:
button.setIcon(Icon myicon);
Is this possible? ;)
You can use the MaterialButton:
MaterialButton button = new MaterialButton(this);
button.setIcon(ContextCompat.getDrawable(this,R.drawable.ic_add_24px));
button.setText("Button");

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With