1
它僅處理ACTION_DOWN(也在新項目中)。沒有事件ACTION_UP,ACTION_MOVE:OnTouchListener僅處理ACTION_DOWN
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
Log.d("DOWN", "S");
break;
case MotionEvent.ACTION_MOVE:
Log.d("MOVE", "S");
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
Log.d("UP", "S");
break;
}
return false;
}
只顯示ACTION_DOWN:'Log.d(Integer.toString(event.getAction()), 「」);' –
你看到我的答案? – yshahak