1st clear previous color first then apply new color and also return true not the false,if you return false then it will listen touch only single time,not multiple times:
relative1.setOnTouchListener(new OnTouchListener()
{
@Override
public boolean onTouch(View arg0, MotionEvent event)
{
if(event.getAction()==MotionEvent.ACTION_DOWN )
{
relative1.setBackgroundColor(getResources().getColor(R.color.tran_black));
}
if((event.getAction()==MotionEvent.ACTION_UP || event.getAction()==MotionEvent.ACTION_CANCEL))
{ //first clear previous color
relative1.setBackgroundColor(0);
//now set new color
relative1.setBackgroundColor(getResources().getColor(android.R.color.transparent));
}
return true;
}
});