处理何时按下按钮,何时松开按钮

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;    
          }    
       });  


posted @ 2013-05-08 20:09  javawebsoa  Views(275)  Comments(0Edit  收藏  举报