
I want to set icon on button on center place through programatically as the above diagram please any one help me...

I want to set icon on button on center place through programatically as the above diagram please any one help me...
May This helps you..
Set background image for button which is in Drawable folder then use below code:
btn.setBackgroundResource(R.drawable.image);
OR
btn.setBackgroundDrawable(getResources().getDrawable(R.drawable.image));
Or use: setCompoundDrawableWithIntrinsicBounds().
Look More Regarding setCompoundDrawableWithIntrinsicBounds() in its documentation : CLICK HERE
Edit:
Try this way: setCompoundDrawableWithIntrinsicBounds(R.drawables.minus,0,0,0);
Add this line in XML: android:paddingLeft="100dp"