title: On Click event for Parent and Child view
body: <p>I have a <code>RelativeLayout</code> and an <code>ImageView</code>.<br>
  The layout is given below - 
  <br></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/rlMain"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="@android:color/black" &gt;
  
  &lt;ImageView
      android:id="@+id/ivIcon"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:background="@drawable/ic_launcher" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>The <code>Activity</code> code is  - 
  <br></p>
  
  <pre><code>public class MainActivity extends Activity implements OnClickListener{
  
  private RelativeLayout rlMain;
  private ImageView ivIcon;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      rlMain = (RelativeLayout) findViewById(R.id.rlMain);
      ivIcon = (ImageView) findViewById(R.id.ivIcon);
      rlMain.setOnClickListener(this);
      ivIcon.setOnClickListener(this);
  }
  
  @Override
  public void onClick(View v) {
      switch (v.getId()) {
      case R.id.rlMain:
          Toast.makeText(this, "Relative Layout clicked", Toast.LENGTH_SHORT).show();
          break;
  
      case R.id.ivIcon:
          Toast.makeText(this, "Image View clicked", Toast.LENGTH_SHORT).show();
          break;
      }
  
  }
  
  }
  </code></pre>
  
  <p>I have applied the on click listener for both the <code>RelativeLayout</code> (parent) and the <code>ImageView</code> (child).<br>
  While clicking on the relative layout - it is handled by the relative layout click handler.(This seems to be correct).<br></p>
  
  <p>While clicking on the Imagview - It is handled by the imageview. (Here is the confusion).<br></p>
  
  <p>Should the click on the imageview get handled by both the parent(relative layout) and child (imageview)?
  What is the logic if only the child view is handling the click?</p>