Until now, the apps we created have used
OnClickListeners to detect user input. However, Android handsets are capable of handling sophisticated touchscreen gestures. These inputs are picked up with an
OnTouchListener and then managed with a
GestureDetector. These detectors and their own listeners are capable of recognizing several of the simplest and most commonly used gestures, such as long presses, double-taps, and flings. At the heart of all touchscreen events is the
MotionEvent class, which handles the individual elements of a gesture, such as when and where a finger is placed or removed from the screen or view. This class provides numerous classes for querying these events and, thus, for constructing ...