I am using a linear layout and frame layout. In the linear layout I keep an image as background and in the frame layout I keep an imageView. In that imageView I give an image.>
For 20% transparency, this worked for me:
Button bu = (Button)findViewById(R.id.button1); bu.getBackground().setAlpha(204);