Trying to figure out how onTouchEvent(MotionEvent e) works. Just look at this:
public boolean onTouchEvent(MotionEvent e)
{
switch(e.getAction() & MotionEvent.ACTION_MASK)
{
case MotionEvent.ACTION_POINTER_DOWN:
int pX = (int) e.getX(e.getPointerId(e.getPointerCount()-1));
break;
}
return true;
}
When I run it on my phone and... jump on the screen with my fingers very quickly, it crashes. Log says that pointerIndex is out of range but how is that possible? Maybe the value of e.getPointerCount() is updated very slowly? What is wrong? Thanks.