For some reason, I was thinking you had a runtime error, but no, you're plainly seeing an error message in Eclipse before you even tried to compile. Even if that code compiled, you have to actually apply your gesture detector against a layout container in order for it to do anything.
You're calling super.onTouch()
in your OnSwipeTouchListener
class, which is a subclass of Object. Object has no onTouch()
method, and that's what the compiler is complaining about. That onTouch()
method needs to go in your activity, not in your custom gesture listener.
I'm going to guess that whatever example you used, you got a bit confused with all the cutting and pasting.
Here's some very simple sample code that detects directional flings that demonstrates how to apply a custom gesture listener:
http://pcfandroid.wordpress.com/2011/07/17/swipe-with-android-android-tutorial/
That article is dead easy to follow, very clear and very simple.