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)
thanks!
Each pointer has a unique id that is assigned when it first goes down (indicated by ACTION_DOWN or ACTION_POINTER_DOWN ). A pointer id remains valid until the pointer eventually goes up (indicated by ACTION_UP or ACTION_POINTER_UP ) or when the gesture is canceled (indicated by ACTION_CANCEL ).
You should always use the method getActionMasked() (or better yet, the compatibility version MotionEventCompat. getActionMasked() ) to retrieve the action of a MotionEvent . Unlike the older getAction() method, getActionMasked() is designed to work with multiple pointers.
Start here if you haven't read it already: http://android-developers.blogspot.com/2010/06/making-sense-of-multitouch.html
Android thinks about touch events in terms of gestures. A gesture in this sense includes all events from the first finger that touches the screen to the last finger that leaves the screen. A single gesture's entire event sequence is always sent to the same view that was picked during the initial ACTION_DOWN unless a parent intercepts the event stream for some reason. If a parent intercepts a child's event stream, the child will get ACTION_CANCEL.
If you're working with multitouch events, always use the value returned by getActionMasked() to determine the action. If you don't need multitouch or are working with an older platform version, you can ignore the ACTION_POINTER_* events.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With