@Override public boolean onTouchEvent(MotionEvent event) { int action = MotionEvent.getActionMasked(event); // Use the action code to determine the type of action that occurred }
@Override public boolean onTouchEvent(MotionEvent event) { int action = MotionEvent.getActionMasked(event); if (action == MotionEvent.ACTION_POINTER_UP) { int pointerIndex = MotionEvent.getActionIndex(event); int pointerId = MotionEvent.getPointerId(event, pointerIndex); // Use the pointerId to determine which pointer was lifted } }In both examples, the package library used is android.view.