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
Try:
public void onclick(View v){ ImageView activity= (ImageView) findViewById(R.id.imageview1); button1.setImageResource(R.drawable.buttonpressed);}