マルチタッチ イベントを検出するにはどうすればよいですか? しようとしているコードは次のとおりです。
ImageView im = (ImageView) findViewById(R.id.imageView1);
im.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction() & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_POINTER_DOWN:
Log.e("case MotionEvent.ACTION_POINTER_DOWN","case MotionEvent.ACTION_POINTER_DOWN");
break;
case MotionEvent.ACTION_DOWN:
Log.e("case MotionEvent.ACTION_DOWN","case MotionEvent.ACTION_DOWN");
break;
case MotionEvent.ACTION_UP:
Log.e("case MotionEvent.ACTION_UP","case MotionEvent.ACTION_UP");
break;
case MotionEvent.ACTION_MOVE:
Log.e("case MotionEvent.ACTION_MOVE","case MotionEvent.ACTION_MOVE");
break;
}
return false;
}
});
最初のタッチを検出し、ログ cat の出力は MotionEvent.ACTION_POINTER_DOWN です。セカンドタッチが行われたかどうかを知る方法は?