兑现按钮按下的效果

实现按钮按下的效果

public boolean onTouch(View v, MotionEvent event)
 {
 Intent intent = new Intent();
 
  switch(v.getId())
  {
  
  case R.id.user_guide:  //使用说明
   if(event.getAction()==MotionEvent.ACTION_DOWN)
   {
    btnUserGuide.setBackgroundResource(R.drawable.main_button_touched);
   }
   else if(event.getAction() == MotionEvent.ACTION_UP)
      {
          btnUserGuide.setBackgroundResource(R.drawable.main_button);
          intent.setClass(Main.this,UserGuider.class);
          startActivity(intent);
      }
     
   break;

 

 

....