Changes

Jump to: navigation, search
Implementing the Listener Class
As previously outlined, it is necessary to create a class that implements the GestureDetector.OnGestureListener interface and, if double tap detection is required, the GestureDetector.OnDoubleTapListener interface. Whilst this can be an entirely new class, it is also perfectly valid to implement this within the current activity class. For the purposes of this example, therefore, we will modify the CommonGesturesActivity class to implement these listener interfaces. Within the Package Explorer panel, locate and double click on the CommonGestures -> src -> <package name> -> CommonGesturesActivity.java file. Once loaded into the editing panel, modify the source code so that it reads as follows to declare the interfaces and to extract and store a reference to the TextView component in the user interface:
 
<google>BUY_ANDROID</google>
<pre>

Navigation menu