tags:

views:

48

answers:

1

Hi,

I have implemented GestureListener, and it is working perfectly, but how can I remove GestureListener from my view?

@Override
public boolean onTouchEvent(MotionEvent event) {
    if ( event.getAction() == MotionEvent.ACTION_UP ) {
        //   remove gestureDetector
    } else {
        mGestureDetector.onTouchEvent(event);
    }
    return true;
}

Regards, Nishant Shah

A: 

I'm not sure what you mean by "remove the gestureDetector".

Instead, you should consider passing the MotionEvent to the GestureDetector first, and processing the event yourself only if the GestureDetector does not, with something like this:

public boolean onTouchEvent(MotionEvent event) {
    if (mGestureDetector.onTouchEvent(event)) {
        return true;
    }

    <your code to process the event here>
}
oli
I mean to say that i have already implemented Gesture in my class but when user scrolling end up, at that time i want to show buttons and user want b able to scroll again on that screen.
Nishant Shah