this.gDetector = new GestureDetectorCompat(listenerclass,listenerclass);
zastanawia mnie, podajesz mu na context pustą listę ? .... spradz takie rozwiązanie żeby podawać "obiekt" na rzecz którego jest ta metoda wywoływana
this.myGestureDetector = new GestureDetectorCompat(this,this);
myGestureDetector.setOnDoubleTapListener(this)
W dokumentacji jest jeszcze informacja o metodzie której u Ciebie nie ma
@Override
public boolean onTouchEvent(MotionEvent event){
this.myGestureDetector.onTouchEvent(event);
// konstruktor klasy narzednej musi byc wczesniej wywolany
return super.onTouchEvent(event);
}
Dokumentacja :
GestureDetector.OnGestureListener notifies users when a particular touch event has occurred. To make it possible for your GestureDetector object to receive events, you override the View or Activity's onTouchEvent() method, and pass along all observed events to the detector instance.