29.11 Registering the Event Listener
In order for the activity to receive notification that the user has performed a gesture on the screen, it is necessary to register the OnGesturePerformedListener event listener on the gLayout view, a reference to which can be obtained using the findViewById method as outlined in the following code fragment:
private void gestureSetup() {
gLibrary =
GestureLibraries.fromRawResource(this,
R.raw.gestures);
if (!gLibrary.load()) {
finish();
}
GestureOverlayView gOverlay = findViewById(R.id.gOverlay);
gOverlay.addOnGesturePerformedListener(this);
}