我能成功使用下面的代碼來記錄在屏幕上觸摸的兩個手指的座標:Android 3.0的手指觸摸檢測
case MotionEvent.ACTION_MOVE:
Log.d("TOUCH", "test ACTION MOVE" + event.getPointerCount());
Log.d("TOUCH", "test ACTION MOVE ID" + event.getPointerId(0) + " "+event.getPointerId(1));
if(event.getPointerCount()==3)
{
x0 = (int) event.getX(event.getPointerId(0));
y0 = (int) event.getY(event.getPointerId(0));
x1 = (int) event.getX(event.getPointerId(1));
y1 = (int) event.getY(event.getPointerId(1));
x2 = (int) event.getX(event.getPointerId(2));
y2 = (int) event.getY(event.getPointerId(2));
Log.d("TOUCH", "test ACTION DOWN " + " values = " + x0 + " " + y0 + " "
+ x1 + " " + y1+ " "+x2 + " " + y2);
}
但在上面的代碼我不是能夠探測到超過2觸摸點在一個實例。即使pointerCount()永遠不會超過2.
如何獲得更多2指的觸摸座標?我在Android 2.2上運行此代碼
嗨,我不知道這會幫助你,但http://getandroidstuff.com/familiar-android-platform-android-3rd-edition-download-書/頁面220,章節Multi-Touch。 – Pasha 2011-05-05 06:56:20