I have a touch event exception that is causing my game to crash on tablets (or more specifically, honeycomb)... My game works fine on my phone and I haven\'t heard of this h
The original posting is using the pointer id when the getX and getY use the pointer index.
It appears to work when you use the ID for a single touch because the id and the index are both 0. It will mess up if you use a multi-touch because the indexes can change.
Example:
Touch 1 Down.
Touch 1 State Index=0. ID=0
Touch 2 Down.
Touch 1 State Index=0. ID=0
Touch 2 State Index=1. ID=1
Touch 1 Release.
Touch 2 State Index=0. ID=1
Try the following code:
final int action = e.getAction();
final int pointerIndex =(action & MotionEvent.ACTION_POINTER_INDEX_MASK)
>> MotionEvent.ACTION_POINTER_INDEX_SHIFT;
float x = event.getX(pointerIndex);
float y = event.getY(pointerIndex);