Im試圖處理活動中的OnTouch事件但我無法處理MotionEvent.ACTION_UP操作。這裏是我的代碼:在活動中處理OnTouch事件
boardView.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction())
{
case MotionEvent.ACTION_DOWN:
showToastNotification("ACTION_DOWN");
break;
case MotionEvent.ACTION_MOVE:
break;
case MotionEvent.ACTION_UP:
showToastNotification("ACTION_UP");
break;
}
return false;
}
});
這是爲什麼?
在此先感謝
了Kobi
需要更多的上下文... – Rich
敬酒不是調試的好方法。使用日誌。 – Falmarri