Was MotionEvent.ACTION_POINTER_DOWN found in the ViewGroup onInterceptTouchEvent method in Android?

I expanded the ViewGroup to create a custom view.

In touch events, when my second finger touched the screen, MotionEvent.ACTION_POINTER_DOWN not detected in the onInterceptTouchEvent method.

Does the onInterceptTouchEvent multi-touch method onInterceptTouchEvent ?

My real device is the phone 2.2. Please, help.

Thanks.

+4
source share
2 answers

You can do the following:

 public boolean onTouch(final View view, MotionEvent event) { final int action = event.getAction(); float xPosition = 0; float yPosition = 0; switch (action){ case MotionEvent.ACTION_DOWN : xPosition = event.getX(); yPosition = event.getY(); break; case MotionEvent.ACTION_POINTER_2_DOWN : xPosition = event.getX(1); yPosition = event.getY(1); break; default: break; } } 
0
source

Try capturing MotionEvent.ACTION_DOWN instead?

-1
source

All Articles