Whilst trying to debug a multi-touch issue, I ended up stripping my onTouchEvent code right down to see what was going on, and found the following issue. Am I missing something? Cheers in advance!
- Finger 1 down: ACTION_DOWN is called – OK.
- Finger 2 down: ACTION_POINTER_DOWN is called – OK
Now this is the problem:
- Finger 1 (the 1st finger) up: ACTION_POINTER_UP is not called. But it IS called when Finger 2 is moved.
By holding Finger 2 as steady as possible when Finger 1 is released, it’s very noticeable that the above is happening.
Here’s my simple test code, the vars are just continuously printed out:
@Override
public boolean onTouchEvent(MotionEvent event)
{
switch (event.getActionMasked())
{
case MotionEvent.ACTION_DOWN:
jpACTIONDOWN++;
return true;
case MotionEvent.ACTION_POINTER_DOWN:
jpACTIONPOINTERDOWN++;
return true;
case MotionEvent.ACTION_UP:
jpACTIONUP++;
return true;
case MotionEvent.ACTION_POINTER_UP:
jpACTIONPOINTERUP++;
return true;
case MotionEvent.ACTION_MOVE:
jpACTIONMOVE++;
return true;
default:
jpDEFAULT++;
}
return false;
}