title: Android ListView Custom Adapter ImageButton
body: <p>This may not be the correct approach, if there is a better way pleas tell me.
  I've created a class of Custom Adapter &amp; in my getView method I inflate the view I want to use </p>
  
  <pre><code>public View getView(int position, View convertView, ViewGroup parent) 
      {
          View v = mInflater.inflate(R.layout.wherelayout, null);
          if (convertView != null) 
          {
              v = convertView;
          }
          HashMap&lt;String, Object&gt; whereHash = (HashMap&lt;String, Object&gt;) this.getItem(position);
          if (whereHash != null) 
          {
              TextView whereId = (TextView) v.findViewById(R.id.tvWhere);
              TextView whereDetails = (TextView) v.findViewById(R.id.tvWhereDetails);
              ImageButton ibDelWhere = (ImageButton) v.findViewById(R.id.ibDelWhere);
  
              whereId.setText((CharSequence) whereHash.get("where"));
              whereDetails.setText((CharSequence) whereHash.get("details"));
              if (ibDelWhere != null)
              {
                  ibDelWhere.setId(position);
                  ibDelWhere.setOnClickListener(new OnClickListener() 
                    {
  
                      @Override
                      public void onClick(View v) 
                      {
                          //do stuff when clicked
                      }
                    }
                  );
              }
          }
          return v;
      }
  </code></pre>
  
  <p>The view consists of 2 TextView aligned to the left &amp; an ImageButton aligned to the right, I want to be able to delete the item from the ListView when the button is clicked. the layout is like this -</p>
  
  <pre><code>    &lt;RelativeLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent" android:orientation="horizontal" android:clickable="true"&gt;
  &lt;TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:textSize="25sp" android:id="@+id/tvWhere" android:textColor="#00FF00" android:text="TextView" android:gravity="top|left" android:layout_alignParentTop="true" android:layout_alignParentLeft="true"&gt;&lt;/TextView&gt;
  &lt;TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/tvWhereDetails" android:textColor="#0000FF" android:text="TextView" android:textSize="18sp" android:layout_below="@+id/tvWhere" android:gravity="bottom|left" android:layout_alignParentLeft="true"&gt;&lt;/TextView&gt;
  &lt;ImageButton android:layout_height="wrap_content" android:layout_width="wrap_content" android:src="@drawable/eraser" android:id="@+id/ibDelWhere" android:layout_alignParentRight="true" android:layout_alignParentTop="true"&gt;&lt;/ImageButton&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>The problem is that when the ImageButton is in the layout, I can click it &amp; the onClick() fires as expected, but I can't click the actual list item itself, i.e. click on the TextView items to fire the ListView.onItemClick that was assigned to it already. If I remove the ImageButton from the layout, then the ListView.onItemClick event fires when I click the item. Is there any way I can enable clicking both the ListView item &amp; the button within the layout ?
  Thanks guys &amp; gals.</p>