I am trying to implement a GestureOverlay and Listener in my application so it can perform actions based on input gestures. I have tried many different things but I cannot figure out what is wrong with my code. Any guidance would be much appreciated!
From onCreate method:
GestureOverlayView gestures = (GestureOverlayView) findViewById(R.id.gesturesoverlay);
gestures.addOnGesturePerformedListener(this);
From main.xml if it is of any help:
<android.gesture.GestureOverlayView
android:id="@+id/gesturesoverlay"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1.0"
android:gestureColor="#FF33B5E5"
android:uncertainGestureColor="#FF33B5E5" />
The error I get is from the gestures.addOnGesturePerformedListener(this); line. The error is
The method addOnGesturePerformedListener(GestureOverlayView.OnGesturePerformedListener) in the type GestureOverlayView is not applicable for the arguments (GestureLauncher).
Thanks again.
The error is saying that the argument to
addOnGesturePerformedListener()needs to be an object that implementsOnGesturePerformedListener. You are passingthiswhich is evidently aGestureLauncherbut does not implementOnGesturePerformedListener.