Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all, I am new to Android. here I want to implement Swipe Gesture to navigate between Activities. I have googled it and found diff. answers in diff. sites, but could not get the exact point.
By reading all of them I got that we need to implement

onTouchEvent() and onFlingEvent().

Does these both functions are enough to implement the Swipe action.
Please specify me on How to proceed in step wise to implement swipe gesture.

Thanks
Ganesh
Posted

http://developer.android.com/reference/android/view/View.OnTouchListener.html[^]

The OnTouchListener has a method onTouch(args) that needs the Argument MotionEvent.

In the MotionEvent[^] you can find what triggered the event.

Please check first if any default behavior is already happening. That would save you lots of time.

Please also check the Development settings on your Android device, there is a setting that let's you identify better the touch event (plotting out coordinates and stuff).

EDIT: Of course please use the previous mentioned GestureListener for detecting the Gesture in the end.
 
Share this answer
 
v2
 
Share this answer
 
Comments
TorstenH. 21-Jan-13 5:50am    
you got google, eh?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900