Code example for GestureDetector.SimpleOnGestureListener

0
    private OnDropListener onDropListener;
 
    public DraggableOverlay(Context context, Drawable defaultMarker) {
        super(boundCenterBottom(defaultMarker));
        this.defaultMarker = defaultMarker;
        this.gesDetect = new GestureDetector(context, new SimpleOnGestureListener());
        populate(); 
    } 
 
    public void setMarker(OverlayItem item) {
        this.point = item.getPoint();
        this.dragItem = item;
        longPressFlag = true;
        Drawable draw = null;
        if (item.getMarker(0) != null) {
            draw = boundCenterBottom(item.getMarker(0));
        } else { 
            draw = defaultMarker;
        } 
        marker = ((BitmapDrawable) draw).getBitmap();
    }