Recall & Review
beginner
What is a GestureDetector in Android?
GestureDetector is a helper class that detects common gestures like taps, scrolls, and flings on touch events.Click to reveal answer
beginner
How do you listen for a single tap gesture using GestureDetector?
Implement GestureDetector.SimpleOnGestureListener and override onSingleTapConfirmed() method to detect single taps.
Click to reveal answer
intermediate
What method do you override to detect a fling gesture?
Override the onFling() method in GestureDetector.SimpleOnGestureListener to detect fling gestures.
Click to reveal answer
intermediate
Why do you need to call gestureDetector.onTouchEvent(event) inside onTouchEvent()?
Because GestureDetector needs to receive touch events to analyze and detect gestures from them.
Click to reveal answer
advanced
What is the difference between onDown() and onSingleTapUp() in GestureDetector?
onDown() is called when the finger first touches the screen; onSingleTapUp() is called when the finger lifts after a tap.
Click to reveal answer
Which class helps detect common gestures like taps and flings in Android?
✗ Incorrect
GestureDetector is designed to detect gestures from touch events.
Which method should you override to detect a scroll gesture?
✗ Incorrect
onScroll() is called when the user scrolls on the screen.
What must you do inside your View's onTouchEvent() to use GestureDetector?
✗ Incorrect
Passing the event to gestureDetector allows it to detect gestures.
Which GestureDetector method is called when the finger first touches the screen?
✗ Incorrect
onDown() is triggered immediately when the finger touches down.
To detect a double tap gesture, which listener interface should you implement?
✗ Incorrect
OnDoubleTapListener handles double tap gestures.
Explain how GestureDetector works to detect user gestures in Android.
Think about how touch events are passed and interpreted.
You got /4 concepts.
Describe the steps to detect a tap gesture on a custom View using GestureDetector.
Focus on setup and event flow.
You got /4 concepts.