Is there a way to specify an alternative background image/color for a Button in the XML file that is going to be applied onClick, or do I have to do a But
onClick
But
In the latest version of the SDK, you would use the setBackgroundResource method.
setBackgroundResource
public void onClick(View v) { if(v == ButtonName) { ButtonName.setBackgroundResource(R.drawable.ImageResource); } }