¡@

Home 

2014/10/16 ¤W¤È 08:14:01

android Programming Glossary: gesturedetector

Android: How to detect double-tap?

http://stackoverflow.com/questions/2217670/android-how-to-detect-double-tap

String queryStr private JSONObject searchResponse private GestureDetector gestureScanner final Runnable mUpdateResults new Runnable public.. products from server true false gestureScanner new GestureDetector this this gestureScanner.setOnDoubleTapListener new OnDoubleTapListener..

Android - HorizontalScrollView within ScrollView Touch Handling

http://stackoverflow.com/questions/2646028/android-horizontalscrollview-within-scrollview-touch-handling

private ArrayList ListItem items null private GestureDetector gestureDetector View.OnTouchListener gestureListener private.. internalWrapper.addView featureLayout gestureDetector new GestureDetector new MyGestureDetector setOnTouchListener new View.OnTouchListener.. featureLayout gestureDetector new GestureDetector new MyGestureDetector setOnTouchListener new View.OnTouchListener @Override public..

How can I make a horizontal ListView in Android? [duplicate]

http://stackoverflow.com/questions/3877040/how-can-i-make-a-horizontal-listview-in-android

import android.view.ContextMenu import android.view.GestureDetector import android.view.MenuItem import android.view.MotionEvent.. import android.view.GestureDetector.SimpleOnGestureListener import android.view.View.OnTouchListener.. Toast.LENGTH_SHORT .show Gesture detection final GestureDetector gestureDetector new GestureDetector new MyGestureDetector g..

Android: How to handle right to left swipe gestures

http://stackoverflow.com/questions/4139288/android-how-to-handle-right-to-left-swipe-gestures

question OnSwipeTouchListener.java import android.view.GestureDetector import android.view.GestureDetector.SimpleOnGestureListener.. import android.view.GestureDetector import android.view.GestureDetector.SimpleOnGestureListener import android.view.MotionEvent import.. implements OnTouchListener private final GestureDetector gestureDetector new GestureDetector new GestureListener public..

how to implement both ontouch and also onfling in a same listview?

http://stackoverflow.com/questions/4184382/how-to-implement-both-ontouch-and-also-onfling-in-a-same-listview

adapter Gesture detection gestureDetector new GestureDetector new MyGestureDetector prosNos gestureListener new View.OnTouchListener.. detection gestureDetector new GestureDetector new MyGestureDetector prosNos gestureListener new View.OnTouchListener public boolean.. gestureListener public class MyGestureDetector extends SimpleOnGestureListener @Override public boolean onFling..

Smooth scrolling in Android

http://stackoverflow.com/questions/4951142/smooth-scrolling-in-android

you need when making such a custom View is implementing a GestureDetector and call its onTouchEvent in your view's onTouchEvent GestureDetector.. and call its onTouchEvent in your view's onTouchEvent GestureDetector mGD new GestureDetector getContext new SimpleOnGestureListener.. in your view's onTouchEvent GestureDetector mGD new GestureDetector getContext new SimpleOnGestureListener @Override public boolean..

How can I change the OverScroll color in Android 2.3.1?

http://stackoverflow.com/questions/5897909/how-can-i-change-the-overscroll-color-in-android-2-3-1

0 private Rect paddingRectangle new Rect GestureDetector listViewGestureDetector Gives the option of short circuiting.. Rect paddingRectangle new Rect GestureDetector listViewGestureDetector Gives the option of short circuiting the overscroll glow fade.. context AttributeSet attrs super context attrs listViewGestureDetector new GestureDetector new ListViewGestureDetector if getTag null..

Android - basic gesture detection

http://stackoverflow.com/questions/937313/android-basic-gesture-detection

be able to detect single clicks also. Gesture detection mGestureDetector new GestureDetector this new GestureDetector.SimpleOnGestureListener.. single clicks also. Gesture detection mGestureDetector new GestureDetector this new GestureDetector.SimpleOnGestureListener public boolean.. detection mGestureDetector new GestureDetector this new GestureDetector.SimpleOnGestureListener public boolean onFling MotionEvent e1..

Android : Html Anchor Link works only once in webview

http://stackoverflow.com/questions/11188348/android-html-anchor-link-works-only-once-in-webview

setContentView myWebView final GestureDetector gestureDetector new GestureDetector new MyGestureDetector View.OnTouchListener.. public boolean onTouch View v MotionEvent event return gestureDetector.onTouchEvent event myWebView.setOnTouchListener gestureListener..

android maps: How to Long Click a Map?

http://stackoverflow.com/questions/1678493/android-maps-how-to-long-click-a-map

implements OnGestureListener private GestureDetector gestureDetector private OnGestureListener onGestureListener public MapGestureDetectorOverlay.. onGestureListener public MapGestureDetectorOverlay gestureDetector new GestureDetector this public MapGestureDetectorOverlay OnGestureListener.. boolean onTouchEvent MotionEvent event MapView mapView if gestureDetector.onTouchEvent event return true return false @Override public..

Android - HorizontalScrollView within ScrollView Touch Handling

http://stackoverflow.com/questions/2646028/android-horizontalscrollview-within-scrollview-touch-handling

ArrayList ListItem items null private GestureDetector gestureDetector View.OnTouchListener gestureListener private static final int.. items.get i .GetDate internalWrapper.addView featureLayout gestureDetector new GestureDetector new MyGestureDetector setOnTouchListener.. public boolean onTouch View v MotionEvent event if gestureDetector.onTouchEvent event return true else if event.getAction MotionEvent.ACTION_UP..

How can I make a horizontal ListView in Android? [duplicate]

http://stackoverflow.com/questions/3877040/how-can-i-make-a-horizontal-listview-in-android

.show Gesture detection final GestureDetector gestureDetector new GestureDetector new MyGestureDetector g OnTouchListener.. boolean onTouch View v MotionEvent event boolean retVal gestureDetector.onTouchEvent event int action event.getAction if action MotionEvent.ACTION_UP..

Gesture in listview android

http://stackoverflow.com/questions/3921138/gesture-in-listview-android

public boolean onTouch View v MotionEvent event if gestureDetector.onTouchEvent event return true return false @Override protected.. @Override public boolean onTouchEvent MotionEvent event if gestureDetector.onTouchEvent event return true else return false class MyGestureDetector.. m_Starbucks final GestureDetector gestureDetector new GestureDetector new MyGestureDetector View.OnTouchListener..

how to implement fling in android listview

http://stackoverflow.com/questions/4030389/how-to-implement-fling-in-android-listview

I have implemented this with the help of gesture detection gestureDetector new GestureDetector new MyGestureDetector gestureListener new.. public boolean onTouch View v MotionEvent event return gestureDetector.onTouchEvent event mList.setOnTouchListener gestureListener..

Adding Fling Gesture to an image view - Android

http://stackoverflow.com/questions/4098198/adding-fling-gesture-to-an-image-view-android

int SWIPE_THRESHOLD_VELOCITY 200 private GestureDetector gestureDetector View.OnTouchListener gestureListener @Override public void onCreate.. R.id.peek peek.setImageResource R.drawable.bluestrip gestureDetector new GestureDetector new MyGestureDetector gestureListener new.. public boolean onTouch View v MotionEvent event if gestureDetector.onTouchEvent event return true return false class MyGestureDetector..

Android: How to handle right to left swipe gestures

http://stackoverflow.com/questions/4139288/android-how-to-handle-right-to-left-swipe-gestures

implements OnTouchListener private final GestureDetector gestureDetector new GestureDetector new GestureListener public boolean onTouch.. final View view final MotionEvent motionEvent return gestureDetector.onTouchEvent motionEvent private final class GestureListener..

how to implement both ontouch and also onfling in a same listview?

http://stackoverflow.com/questions/4184382/how-to-implement-both-ontouch-and-also-onfling-in-a-same-listview

mContactList.setAdapter adapter Gesture detection gestureDetector new GestureDetector new MyGestureDetector prosNos gestureListener.. public boolean onTouch View v MotionEvent event if gestureDetector.onTouchEvent event return true return false mContactList.setOnTouchListener..

DoubleTap in android

http://stackoverflow.com/questions/4804798/doubletap-in-android

like that public class MyView extends View GestureDetector gestureDetector public MyView Context context AttributeSet attrs super context.. attrs super context attrs creating new gesture detector gestureDetector new GestureDetector context new GestureListener skipping measure.. @Override public boolean onTouchEvent MotionEvent e return gestureDetector.onTouchEvent e private class GestureListener extends GestureDetector.SimpleOnGestureListener..

Swipe/Fling tab-changing in conjunction with ScrollView?

http://stackoverflow.com/questions/5102993/swipe-fling-tab-changing-in-conjunction-with-scrollview

gestures public boolean onTouchEvent MotionEvent event if gestureDetector.onTouchEvent event return true else return false More general.. source code below it's probably not very vital. The gestureDetector inside my Tabs class with its associated listener Gestures gestureDetector.. inside my Tabs class with its associated listener Gestures gestureDetector new GestureDetector new MyGestureDetector gestureListener new..

How do I modify TouchImageView with double tap to zoom in and out?

http://stackoverflow.com/questions/7704086/how-do-i-modify-touchimageview-with-double-tap-to-zoom-in-and-out

mScaleDetector private GestureDetector gestureDetector Context context public TouchImageView Context context AttributeSet.. context init context public void init Context context gestureDetector new GestureDetector new DoubleTapGestureListener super.setClickable.. public boolean onTouch View v MotionEvent event if gestureDetector.onTouchEvent event return true mScaleDetector.onTouchEvent..

Android - basic gesture detection

http://stackoverflow.com/questions/937313/android-basic-gesture-detection

int SWIPE_THRESHOLD_VELOCITY 200 private GestureDetector gestureDetector View.OnTouchListener gestureListener @Override protected void.. super.onCreate savedInstanceState ... Gesture detection gestureDetector new GestureDetector this new MyGestureDetector gestureListener.. public boolean onTouch View v MotionEvent event return gestureDetector.onTouchEvent event class MyGestureDetector extends SimpleOnGestureListener..

Android: How to detect double-tap?

http://stackoverflow.com/questions/2217670/android-how-to-detect-double-tap

SearchItem sResultsArr new ArrayList SearchItem private String queryStr private JSONObject searchResponse private GestureDetector gestureScanner final Runnable mUpdateResults new Runnable public void run updateListUi @Override public void onCreate Bundle.. method stub pd ProgressDialog.show home.this null Loading products from server true false gestureScanner new GestureDetector this this gestureScanner.setOnDoubleTapListener new OnDoubleTapListener public boolean onDoubleTap MotionEvent e viewA.setText..

Android - HorizontalScrollView within ScrollView Touch Handling

http://stackoverflow.com/questions/2646028/android-horizontalscrollview-within-scrollview-touch-handling

of my code public class HomeFeatureLayout extends HorizontalScrollView private ArrayList ListItem items null private GestureDetector gestureDetector View.OnTouchListener gestureListener private static final int SWIPE_MIN_DISTANCE 5 private static final.. items.get i .GetTitle date.setText items.get i .GetDate internalWrapper.addView featureLayout gestureDetector new GestureDetector new MyGestureDetector setOnTouchListener new View.OnTouchListener @Override public boolean onTouch View v MotionEvent event.. date.setText items.get i .GetDate internalWrapper.addView featureLayout gestureDetector new GestureDetector new MyGestureDetector setOnTouchListener new View.OnTouchListener @Override public boolean onTouch View v MotionEvent event if gestureDetector.onTouchEvent..

How can I make a horizontal ListView in Android? [duplicate]

http://stackoverflow.com/questions/3877040/how-can-i-make-a-horizontal-listview-in-android

import android.content.res.TypedArray import android.os.Bundle import android.view.ContextMenu import android.view.GestureDetector import android.view.MenuItem import android.view.MotionEvent import android.view.View import android.view.ViewGroup import.. android.view.View import android.view.ViewGroup import android.view.ContextMenu.ContextMenuInfo import android.view.GestureDetector.SimpleOnGestureListener import android.view.View.OnTouchListener import android.widget.AdapterView import android.widget.BaseAdapter.. View v int position long id Toast.makeText Gallery1.this position Toast.LENGTH_SHORT .show Gesture detection final GestureDetector gestureDetector new GestureDetector new MyGestureDetector g OnTouchListener gestureListener new OnTouchListener @Override..

Android: How to handle right to left swipe gestures

http://stackoverflow.com/questions/4139288/android-how-to-handle-right-to-left-swipe-gestures

this android swipe gesture recognition share improve this question OnSwipeTouchListener.java import android.view.GestureDetector import android.view.GestureDetector.SimpleOnGestureListener import android.view.MotionEvent import android.view.View import.. share improve this question OnSwipeTouchListener.java import android.view.GestureDetector import android.view.GestureDetector.SimpleOnGestureListener import android.view.MotionEvent import android.view.View import android.view.View.OnTouchListener.. import android.view.View.OnTouchListener public class OnSwipeTouchListener implements OnTouchListener private final GestureDetector gestureDetector new GestureDetector new GestureListener public boolean onTouch final View view final MotionEvent motionEvent..

how to implement both ontouch and also onfling in a same listview?

http://stackoverflow.com/questions/4184382/how-to-implement-both-ontouch-and-also-onfling-in-a-same-listview

listClickListener mContactList.setAdapter adapter Gesture detection gestureDetector new GestureDetector new MyGestureDetector prosNos gestureListener new View.OnTouchListener public boolean onTouch View v MotionEvent event.. listClickListener mContactList.setAdapter adapter Gesture detection gestureDetector new GestureDetector new MyGestureDetector prosNos gestureListener new View.OnTouchListener public boolean onTouch View v MotionEvent event if gestureDetector.onTouchEvent.. event return true return false mContactList.setOnTouchListener gestureListener public class MyGestureDetector extends SimpleOnGestureListener @Override public boolean onFling MotionEvent e1 MotionEvent e2 float velocityX float velocityY..

Smooth scrolling in Android

http://stackoverflow.com/questions/4951142/smooth-scrolling-in-android

fling in Android's API is not hard to achieve. First thing you need when making such a custom View is implementing a GestureDetector and call its onTouchEvent in your view's onTouchEvent GestureDetector mGD new GestureDetector getContext new SimpleOnGestureListener.. when making such a custom View is implementing a GestureDetector and call its onTouchEvent in your view's onTouchEvent GestureDetector mGD new GestureDetector getContext new SimpleOnGestureListener @Override public boolean onScroll MotionEvent e1 MotionEvent.. View is implementing a GestureDetector and call its onTouchEvent in your view's onTouchEvent GestureDetector mGD new GestureDetector getContext new SimpleOnGestureListener @Override public boolean onScroll MotionEvent e1 MotionEvent e2 float distanceX..

How can I change the OverScroll color in Android 2.3.1?

http://stackoverflow.com/questions/5897909/how-can-i-change-the-overscroll-color-in-android-2-3-1

static float MAX_GLOW_SIZE 93f private float scrollDistanceSinceBoundary 0 private Rect paddingRectangle new Rect GestureDetector listViewGestureDetector Gives the option of short circuiting the overscroll glow fade Such as by scrolling away from the.. 93f private float scrollDistanceSinceBoundary 0 private Rect paddingRectangle new Rect GestureDetector listViewGestureDetector Gives the option of short circuiting the overscroll glow fade Such as by scrolling away from the overscrolled edge boolean.. boolean interruptFade false public CustomGlowListView Context context AttributeSet attrs super context attrs listViewGestureDetector new GestureDetector new ListViewGestureDetector if getTag null getTag .toString .equalsIgnoreCase ListView listView new..

Android - basic gesture detection

http://stackoverflow.com/questions/937313/android-basic-gesture-detection

What when and how should I attach this listener I need to be able to detect single clicks also. Gesture detection mGestureDetector new GestureDetector this new GestureDetector.SimpleOnGestureListener public boolean onFling MotionEvent e1 MotionEvent e2.. should I attach this listener I need to be able to detect single clicks also. Gesture detection mGestureDetector new GestureDetector this new GestureDetector.SimpleOnGestureListener public boolean onFling MotionEvent e1 MotionEvent e2 float velocityX float.. I need to be able to detect single clicks also. Gesture detection mGestureDetector new GestureDetector this new GestureDetector.SimpleOnGestureListener public boolean onFling MotionEvent e1 MotionEvent e2 float velocityX float velocityY int dx int..

Android : Html Anchor Link works only once in webview

http://stackoverflow.com/questions/11188348/android-html-anchor-link-works-only-once-in-webview

true myWebView.loadUrl file android_asset chapters.html setContentView myWebView final GestureDetector gestureDetector new GestureDetector new MyGestureDetector View.OnTouchListener gestureListener new View.OnTouchListener public boolean.. View.OnTouchListener gestureListener new View.OnTouchListener public boolean onTouch View v MotionEvent event return gestureDetector.onTouchEvent event myWebView.setOnTouchListener gestureListener class MyGestureDetector extends SimpleOnGestureListener..

android maps: How to Long Click a Map?

http://stackoverflow.com/questions/1678493/android-maps-how-to-long-click-a-map

the class public class MapGestureDetectorOverlay extends Overlay implements OnGestureListener private GestureDetector gestureDetector private OnGestureListener onGestureListener public MapGestureDetectorOverlay gestureDetector new GestureDetector this public.. private GestureDetector gestureDetector private OnGestureListener onGestureListener public MapGestureDetectorOverlay gestureDetector new GestureDetector this public MapGestureDetectorOverlay OnGestureListener onGestureListener this setOnGestureListener.. this setOnGestureListener onGestureListener @Override public boolean onTouchEvent MotionEvent event MapView mapView if gestureDetector.onTouchEvent event return true return false @Override public boolean onDown MotionEvent e if onGestureListener null return..

Android - HorizontalScrollView within ScrollView Touch Handling

http://stackoverflow.com/questions/2646028/android-horizontalscrollview-within-scrollview-touch-handling

class HomeFeatureLayout extends HorizontalScrollView private ArrayList ListItem items null private GestureDetector gestureDetector View.OnTouchListener gestureListener private static final int SWIPE_MIN_DISTANCE 5 private static final int SWIPE_THRESHOLD_VELOCITY.. title.setText items.get i .GetTitle date.setText items.get i .GetDate internalWrapper.addView featureLayout gestureDetector new GestureDetector new MyGestureDetector setOnTouchListener new View.OnTouchListener @Override public boolean onTouch View.. setOnTouchListener new View.OnTouchListener @Override public boolean onTouch View v MotionEvent event if gestureDetector.onTouchEvent event return true else if event.getAction MotionEvent.ACTION_UP event.getAction MotionEvent.ACTION_CANCEL..

How can I make a horizontal ListView in Android? [duplicate]

http://stackoverflow.com/questions/3877040/how-can-i-make-a-horizontal-listview-in-android

long id Toast.makeText Gallery1.this position Toast.LENGTH_SHORT .show Gesture detection final GestureDetector gestureDetector new GestureDetector new MyGestureDetector g OnTouchListener gestureListener new OnTouchListener @Override public boolean.. gestureListener new OnTouchListener @Override public boolean onTouch View v MotionEvent event boolean retVal gestureDetector.onTouchEvent event int action event.getAction if action MotionEvent.ACTION_UP action MotionEvent.ACTION_CANCEL retVal..

Gesture in listview android

http://stackoverflow.com/questions/3921138/gesture-in-listview-android

R.id.MyList names gestureListener new ListView.OnTouchListener public boolean onTouch View v MotionEvent event if gestureDetector.onTouchEvent event return true return false @Override protected void onListItemClick ListView l View v int position long.. this You selected keyword Toast.LENGTH_LONG .show @Override public boolean onTouchEvent MotionEvent event if gestureDetector.onTouchEvent event return true else return false class MyGestureDetector extends SimpleOnGestureListener @Override public.. lv.setAdapter new ArrayAdapter String this android.R.layout.simple_list_item_1 m_Starbucks final GestureDetector gestureDetector new GestureDetector new MyGestureDetector View.OnTouchListener gestureListener new View.OnTouchListener public boolean..

how to implement fling in android listview

http://stackoverflow.com/questions/4030389/how-to-implement-fling-in-android-listview

android listview swipe share improve this question I have implemented this with the help of gesture detection gestureDetector new GestureDetector new MyGestureDetector gestureListener new View.OnTouchListener public boolean onTouch View v MotionEvent..

Adding Fling Gesture to an image view - Android

http://stackoverflow.com/questions/4098198/adding-fling-gesture-to-an-image-view-android

static final int SWIPE_MAX_OFF_PATH 250 private static final int SWIPE_THRESHOLD_VELOCITY 200 private GestureDetector gestureDetector View.OnTouchListener gestureListener @Override public void onCreate Bundle savedInstanceState super.onCreate savedInstanceState.. setContentView R.layout.main peek ImageView findViewById R.id.peek peek.setImageResource R.drawable.bluestrip gestureDetector new GestureDetector new MyGestureDetector gestureListener new View.OnTouchListener public boolean onTouch View v MotionEvent.. new MyGestureDetector gestureListener new View.OnTouchListener public boolean onTouch View v MotionEvent event if gestureDetector.onTouchEvent event return true return false class MyGestureDetector extends SimpleOnGestureListener @Override public..

Android: How to handle right to left swipe gestures

http://stackoverflow.com/questions/4139288/android-how-to-handle-right-to-left-swipe-gestures

public class OnSwipeTouchListener implements OnTouchListener private final GestureDetector gestureDetector new GestureDetector new GestureListener public boolean onTouch final View view final MotionEvent motionEvent return gestureDetector.onTouchEvent.. new GestureDetector new GestureListener public boolean onTouch final View view final MotionEvent motionEvent return gestureDetector.onTouchEvent motionEvent private final class GestureListener extends SimpleOnGestureListener private static final int SWIPE_THRESHOLD..

how to implement both ontouch and also onfling in a same listview?

http://stackoverflow.com/questions/4184382/how-to-implement-both-ontouch-and-also-onfling-in-a-same-listview

Listener mContactList.setOnItemClickListener listClickListener mContactList.setAdapter adapter Gesture detection gestureDetector new GestureDetector new MyGestureDetector prosNos gestureListener new View.OnTouchListener public boolean onTouch View.. prosNos gestureListener new View.OnTouchListener public boolean onTouch View v MotionEvent event if gestureDetector.onTouchEvent event return true return false mContactList.setOnTouchListener gestureListener public class MyGestureDetector..

DoubleTap in android

http://stackoverflow.com/questions/4804798/doubletap-in-android

android share improve this question Or more easily like that public class MyView extends View GestureDetector gestureDetector public MyView Context context AttributeSet attrs super context attrs creating new gesture detector gestureDetector new GestureDetector.. gestureDetector public MyView Context context AttributeSet attrs super context attrs creating new gesture detector gestureDetector new GestureDetector context new GestureListener skipping measure calculation and drawing delegate the event to the gesture.. and drawing delegate the event to the gesture detector @Override public boolean onTouchEvent MotionEvent e return gestureDetector.onTouchEvent e private class GestureListener extends GestureDetector.SimpleOnGestureListener @Override public boolean onDown..

Swipe/Fling tab-changing in conjunction with ScrollView?

http://stackoverflow.com/questions/5102993/swipe-fling-tab-changing-in-conjunction-with-scrollview

is handled by the ScrollView @Override Used for swipe gestures public boolean onTouchEvent MotionEvent event if gestureDetector.onTouchEvent event return true else return false More general source code below it's probably not very vital. The gestureDetector.. event return true else return false More general source code below it's probably not very vital. The gestureDetector inside my Tabs class with its associated listener Gestures gestureDetector new GestureDetector new MyGestureDetector gestureListener.. below it's probably not very vital. The gestureDetector inside my Tabs class with its associated listener Gestures gestureDetector new GestureDetector new MyGestureDetector gestureListener new View.OnTouchListener @Override public boolean onTouch View..

How do I modify TouchImageView with double tap to zoom in and out?

http://stackoverflow.com/questions/7704086/how-do-i-modify-touchimageview-with-double-tap-to-zoom-in-and-out

float right bottom origWidth origHeight bmWidth bmHeight ScaleGestureDetector mScaleDetector private GestureDetector gestureDetector Context context public TouchImageView Context context AttributeSet attrs super context attrs init context public TouchImageView.. attrs init context public TouchImageView Context context super context init context public void init Context context gestureDetector new GestureDetector new DoubleTapGestureListener super.setClickable true this.context context mScaleDetector new ScaleGestureDetector.. ScaleType.MATRIX setOnTouchListener new OnTouchListener @Override public boolean onTouch View v MotionEvent event if gestureDetector.onTouchEvent event return true mScaleDetector.onTouchEvent event matrix.getValues m float x m Matrix.MTRANS_X float y..

Android - basic gesture detection

http://stackoverflow.com/questions/937313/android-basic-gesture-detection

static final int SWIPE_MAX_OFF_PATH 250 private static final int SWIPE_THRESHOLD_VELOCITY 200 private GestureDetector gestureDetector View.OnTouchListener gestureListener @Override protected void onCreate Bundle savedInstanceState super.onCreate savedInstanceState.. @Override protected void onCreate Bundle savedInstanceState super.onCreate savedInstanceState ... Gesture detection gestureDetector new GestureDetector this new MyGestureDetector gestureListener new View.OnTouchListener public boolean onTouch View v MotionEvent.. MyGestureDetector gestureListener new View.OnTouchListener public boolean onTouch View v MotionEvent event return gestureDetector.onTouchEvent event class MyGestureDetector extends SimpleOnGestureListener @Override public boolean onFling MotionEvent..