I recently implemented this using a Gesture Detector. Note in my implementation I only needed to know when the user lifts their finger following a drag gesture.
Extend SimpleOnDrawGestureListener and override the onScroll method:
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
scrolling = true;
return super.onScroll(e1, e2, distanceX, distanceY);
}
In the onTouch method of the MapView see if the scroll variable is true when the event s MotionEvent.ACTION_UP is called. If it is then the user has touched the map, moved their finger and released the map. If you want to be notified during the drag operation implement a callback in the onScroll method.
this.mapView.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if (gestureDetector.onTouchEvent(event)) {
return true;
}
if (event.getAction() == MotionEvent.ACTION_UP) {
if (gestureLis.scrolling) {
gestureLis.scrolling = false;
}
}
return false;
}
});
Andy