I have created this button programmatically and I am able to set the icon on the by using below code
Drawable icon = context.getResources().getDrawable(iconResourceId);
button.setCompoundDrawablesWithIntrinsicBounds(icon, null, null, null);
Now, I want to have another image (icon) on the right top corner, please see the below image:
I have tried to add both images, by using below code:
Drawable icon = context.getResources().getDrawable(iconResourceId);
Drawable icon2 = context.getResources().getDrawable(iconResourceId2);
button.setCompoundDrawablesWithIntrinsicBounds(icon, null, icon2, null);
and, I am getting below results:
Can anyone please tell me, how can I align it to the right top corner?


