Reputation: 13
It handles only ACTION_DOWN (in new project also). No event ACTION_UP, ACTION_MOVE:
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;
}
Upvotes: 1
Views: 484
Reputation: 5096
That because:
return false;
It mean you don't receive any events after ACTION_DOWN
.
Change to:
return true;
Upvotes: 2