title: How to get fling on activity and onClickListener on button?
body: <p>I have an xml layout with buttons in relative layout. I want the layout to react on fling. I added a  linear layout as last child of a relative layout and it covered the whole screen and then I added onTouch in it to get the fling. The problem is that it never gets to the onclick listener on buttons (which is under the linear layout) but when I make the touch listener to return false my button gets called but the fling does not. How to get both of the events?</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent" &gt;
  
  &lt;ImageView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentBottom="true"
      android:layout_alignParentLeft="true"
      android:src="@drawable/img_calendar" /&gt;
  
  &lt;ImageView
      android:id="@+id/child"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentBottom="true"
      android:layout_alignParentLeft="true"
      android:layout_marginLeft="60dp"
      android:src="@drawable/img_child" /&gt;
  
  &lt;ImageView
      android:id="@+id/ball"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignLeft="@id/child"
      android:layout_alignParentBottom="true"
      android:layout_marginLeft="250dp"
      android:src="@drawable/img_ball" /&gt;
  
  &lt;ImageView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentBottom="true"
      android:layout_alignParentRight="true"
      android:src="@drawable/img_logo" /&gt;
  
  &lt;ImageView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentRight="true"
      android:layout_alignParentTop="true"
      android:src="@drawable/img_logo_second" /&gt;
  
  &lt;ImageView
      android:id="@+id/info"
      android:layout_width="100dp"
      android:layout_height="100dp"
      android:layout_alignParentRight="true"
      android:layout_alignParentTop="true"
      android:layout_margin="10dp"
      android:src="@drawable/ic_information" /&gt;
  
  &lt;LinearLayout
      android:id="@+id/linear" 
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="horizontal"
      android:background="@android:color/transparent"
      &gt;&lt;/LinearLayout&gt;
  </code></pre>
  
  <p>  </p>
  
  <pre><code>public class GestureListener extends Activity{
  
      OnTouchListener toach_listener_cell = new OnTouchListener() {
          int id = 0;
          View v = null;
          View previous_for_singleTap_View = null;
          GestureDetector gestureDetector = new GestureDetector(getApplication(),
                  new GestureDetector.SimpleOnGestureListener() {
                      @Override
                      public boolean onDoubleTap(MotionEvent e) {
                           Toast.makeText(GestureListener.this, "DoubleTap",
                           Toast.LENGTH_LONG).show();
                          return super.onDoubleTap(e);
  
                      }
  
                      @Override
                      public boolean onSingleTapConfirmed(MotionEvent e) {
                           if(v.getId()==R.id.info)
                               test();
                           else if(v.getId()==R.id.linear)
                           Toast.makeText(GestureListener.this,
                           "singleLn", Toast.LENGTH_LONG).show();
                          return false;
                      }
  
                      @Override
                      public void onLongPress(MotionEvent e) {
                          /* Toast.makeText(GestureListener.this,
                           "onLongPress", Toast.LENGTH_LONG).show();*/
  
                      }
                      @Override
                      public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
  
                          return false;
                      };
                  });
  
          @Override
          public boolean onTouch(View v, MotionEvent event) {
              // TODO Auto-generated method stub
              id = v.getId();
              this.v = v;
              gestureDetector.onTouchEvent(event);
              return false;
          }
      };
      LinearLayout check;
  
      public void test(){
          Toast.makeText(GestureListener.this,
                   "info", Toast.LENGTH_LONG).show();
      }
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main_screen);
          check=(LinearLayout) findViewById(R.id.linear);
  
          ImageView info=(ImageView) findViewById(R.id.info);
  
          check.setOnTouchListener(toach_listener_cell);
          info.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View arg0) {
                  // TODO Auto-generated method stub
                  test();
              }
          });
      }
  
  }
  </code></pre>