So, I am trying to check multiple screen touches with an onTouchEvent, but it still only seems to read the first touch. Can anyone help? Here is my code:
public boolean onTouchEvent(MotionEvent e)
{
int num = e.getPointerCount();
for(int a = 0;a<num;a++)
{
int x = (int) e.getX(e.getPointerId(a));
int y = (int) e.getY(e.getPointerId(a));
check(x,y);
}
return false;
}
I looked over a lot of these forums, but most of the multi touch related topics were about zooming.
Your code works well on my device (Nexus S, Android 2.3). It reads all touches.
Here is the test code:
Here is the log (touch with 5 fingers):
What is your Android device and OS version?
This happens because your method will
return false
when you want to make move. All multi finger actions shouldreturn true
.