Posts

Showing posts with the label Android - Multitouch Tutorial

Android - Multitouch Tutorial

Image
Multi-touch gesture happens when more then one finger touches the screen at the same time. Android allows us to detect these gestures. Android system generates the following touch events whenever multiple fingers touches the screen at the same time. Sr.No Event & description 1 ACTION_DOWN For the first pointer that touches the screen. This starts the gesture. 2 ACTION_POINTER_DOWN For extra pointers that enter the screen beyond the first. 3 ACTION_MOVE A change has happened during a press gesture. 4 ACTION_POINTER_UP Sent when a non-primary pointer goes up. 5 ACTION_UP Sent when the last pointer leaves the screen. So in order to detect any of the above mention event , you need to override onTouchEvent()  method and check these events manually. Its syntax is given below − public boolean onTouchEvent ( MotionEvent ev ){ final int actionPeformed = ev . getAction (); switch ( actionPeformed ){ case MotionEvent . ACTION_DOWN :{ break ; ...