Q: Using two SimpleOnGestureListener I would like to implemtent an app where two counters (or more) increment and decrement with slide up and down. Therefore my idea is that the "Main Activity" use two custom views (called CounterView.java).
The app display the two Counters, but the interaction doesn't work with the SimpleOnGestureListener.
Here is the code.
activity_main.xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/RelativeLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="top"
    android:orientation="vertical"
    android:background="@color/opaque_black"
    tools:context=".MainActivity" >

<de.thomaslaemmlein.counter.CounterView
    android:id="@+id/counterView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true" >
</de.thomaslaemmlein.counter.CounterView>

<de.thomaslaemmlein.counter.CounterView
    android:id="@+id/counterView2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="10dp"
    android:layout_toRightOf="@id/counterView1" >
</de.thomaslaemmlein.counter.CounterView>


MainActivity.java:
package de.thomaslaemmlein.counter;


import android.os.Bundle;
import android.app.Activity;
import android.util.Log;

public class MainActivity extends Activity {

    public MainActivity()
    {       
        Log.d("MainActivity", "Constructor");
    }

    protected void onDestroy() 
    {
        Log.d("MainActivity", "onDestroy");
        super.onDestroy();
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        Log.d("MainActivity", "onCreate");

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

}

counter_view.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <TextView
        android:id="@+id/counterTextView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@color/opaque_white"
        android:includeFontPadding="false"
        android:text="0"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textSize="250sp" />

</RelativeLayout>

CounterView.java:
package de.thomaslaemmlein.counter;


import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.GestureDetector;
import android.view.GestureDetector.SimpleOnGestureListener;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

public class CounterView extends LinearLayout {
    TextView m_CounterTextView;

    private int m_CurrentNumber;

    private int m_MaximalNumber = 99;

    public CounterView(Context context) {
        super(context);
        init();
    }

    public CounterView(Context context, AttributeSet attr) 
    {
        super(context, attr);
        init();
    }

    private void init()
    {
        Log.d("CounterView", "init");

        LayoutInflater inflater = LayoutInflater.from(getContext());
        View root = inflater.inflate(R.layout.counter_view, this, false);

        m_CurrentNumber = 0;

        m_CounterTextView = (TextView)root.findViewById(R.id.counterTextView);

        m_CounterTextView.setText( Integer.toString(m_CurrentNumber));

        addView(root);
    }

    @Override
     public boolean onTouchEvent(MotionEvent event) {
        return gestureDetector.onTouchEvent(event);
     }

    SimpleOnGestureListener simpleOnGestureListener
       = new SimpleOnGestureListener(){


      @Override
      public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
        float velocityY) {
       String swipe = "";
       float sensitvity = 50;

       // TODO Auto-generated method stub
       if((e1.getX() - e2.getX()) > sensitvity){
        swipe += "Swipe Left;";
       }else if((e2.getX() - e1.getX()) > sensitvity){
        swipe += "Swipe Right;";
       }else{
        swipe += ";";
       }

       if((e1.getY() - e2.getY()) > sensitvity){
        swipe += "Swipe Up;";
        if (m_CurrentNumber < m_MaximalNumber)
        {
            m_CurrentNumber++;
            m_CounterTextView.setText( Integer.toString(m_CurrentNumber));      
        }
       }else if((e2.getY() - e1.getY()) > sensitvity){
           if (m_CurrentNumber > 0)
           {
               m_CurrentNumber--;
               m_CounterTextView.setText( Integer.toString(m_CurrentNumber));
           }
        swipe += "Swipe Down;";
       }else{
        swipe += ";";
       }

       Log.d("onFling", swipe);

       return super.onFling(e1, e2, velocityX, velocityY);
      }
       };

       GestureDetector gestureDetector
       = new GestureDetector(simpleOnGestureListener);

}

The method "onFling" won't be called. 
Does anybody help me in this case?

A: Replace the onTouchEvent with,
@Override
public boolean onTouchEvent(MotionEvent event) {
 gestureDetector.onTouchEvent(event);

 return true; // This function must return true for onFling() to be called.
}

