title: Touch event on FrameLayout
body: <p>I have a layout like this:</p>
  
  <ul>
  <li>RelativeLayout
  
  <ul>
  <li>FrameLayout
  
  <ul>
  <li>Fragment (google maps layer)</li>
  </ul></li>
  <li>Checkbox</li>
  <li>... other buttons and stuff</li>
  </ul></li>
  </ul>
  
  <p>Now I want to capture touch events on the <code>FrameLayout</code> when the <code>Checkbox</code> is checked. I got it working with <code>dispatchTouchEvent</code> instead of <code>onTouch</code>, but then the problem is that I also get touch response when I press the Checkbox button. I want to exclude it but I can't figure out how it works... </p>
  
  <p>Do I need to create a new class or something?</p>
  
  <p>This is my code, stripped a lot:</p>
  
  <pre><code>public class Main extends Activity implements LocationListener, OnTouchListener {
  
    @Override
    protected void onCreate(Bundle savedInstanceState) {
  
      super.onCreate(savedInstanceState);
  
      FrameLayout frame = (FrameLayout) findViewById(R.id.mapFrame);
      frame.setOnTouchListener((OnTouchListener) this);
    }
  
    public boolean onTouch(View v, MotionEvent e) {
  
      //doing things
  
      return true;
    }
  }
  </code></pre>