title: Android onClickListener for a whole layout with a different onClickListener for an internal view
body: <p>I have a simple LinearLayout that consists of a <code>TextView</code> and an <code>EditText</code>. The behaviour that I'd like to achieve is to be able to click on the EditText and handle it like normal, but treat the encompassing LinearLayout as a button that launches a new activity.</p>
  
  <p>So for example, if the user clicks the space around the button in the view, a new activity is launched. If the user clicks on the EditText, then the keyboard appears and the user can populate the EditText.</p>
  
  <p>Here is the simple onClickListener for the layout, which simply states that it has been clicked:</p>
  
  <pre><code>LinearLayout test = (LinearLayout)findViewById(R.id.linearLayout1);
      test.setOnClickListener(new OnClickListener(){
  
          @Override
          public void onClick(View arg0) {
              System.out.println("layout clicked");
          }
      });
  </code></pre>
  
  <p>And the EditText has an OnFocusChangeListener that will simply state when it has gotten focus:</p>
  
  <pre><code>@Override
  public void onFocusChange(View v, boolean hasFocus) {
      System.out.println("EditText clicked");
  }
  </code></pre>
  
  <p>Results:</p>
  
  <p>-When the user clicks on the layout, the result "layout clicked" is correct<br>
  -When the user clicks on the edittext, the result is "layout clicked" followed by "EditText clicked", which is not correct. I'd like to ignore the linear layout's onClick event for this case.</p>