androidmulti-touch

Android: difference between ACTION_UP and ACTION_POINTER_UP


From the android doc alone I dont really understand the difference between ACTION_UP and ACTION_POINTER_UP. http://developer.android.com/reference/android/view/MotionEvent.html#ACTION_DOWN

Basically I want to capture the event when one finger is released from the screen (even if another one may still be touching it)


Solution

  • I believe it stemmed from Multi-touch being added in, ACTION_UP has been in since API Level 1, but ACTION_POINTER_UP was added in API Level 5 when multi-touch was added.

    The result you get will depend on which method you are calling, getAction() would return ACTION_UP whereas getActionMasked() would give ACTION_POINTER_UP but also allow you to call getActionIndex() to find out which of the multi-touch pointers has just been raised. I think this is what you want to do.