I created a button in the layout . In the Drawable folder I created a XML file named btn01_state. The btn0
button
layout
Drawable
XML file
btn01_state
btn0
Simple way
btn.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub btn.setBackgroundDrawable(getResources().getDrawable(R.drawable.locationbutton_on)); } });