Android : I can't implement onFling, onScroll and more methods

on Saturday, September 13, 2014


I am trying to work with OnGestureListener , like I saw here : http://mrbool.com/how-to-work-with-swipe-gestures-in-android/28088


My goal is to move some Canvas Rectangle view to the right with swipe. I want the rectangle to get moved to the right out of the screen, so I created a thread which refresh the screen every [x] seconds, and I created a method : moveRight() for the rectangle, the method just increases the X point of the rectangle. Everything till here is working fine.



  • Where the problem is :


When I implements OnGestureListener interface in the activity, the methods I can implement are : onGesture , onGestureCancelled , onGestureEnded , onGestureStarted . For some reason, I can't implement onFling, onScroll and the rest known methods.


I work with minimum Android 2.2 Froyo. What can I do to solve this ?


Thanks guys.


0 comments:

Post a Comment