处理何时按下按钮,何时松开按钮
imageButton.setOnTouchListener(new OnTouchListener(){ @Override public boolean onTouch(View v, MotionEvent event) { if(event.getAction() == MotionEvent.ACTION_DOWN){ //按下 }else if(event.getAction() == MotionEvent.ACTION_UP){ //抬起 } return false; } });