title: Android listview onclicklistener not working with checkbox
body: <p>In my listview there is a checkbox, textviews and an imageview. When I click on an item, the onclicklistnere is not working. I know this is because the checkbox has its own listener and it overrides the listview onclicklistener. Fine. When I set</p>
  
  <pre><code>android:focusable="false"
  android:focusableInTouchMode="false"
  </code></pre>
  
  <p>in the checkbox, I can click on the list item but the checkbox becames orange as well (like the item).</p>
  
  <p>So this is a half solution, does anyone know a better one?</p>
  
  <p>This is the class:</p>
  
  <pre><code>    public class ListViewTutorial2Activity extends Activity {
  
      SimpleAdapter mSchedule;
      ListView list;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
          list = (ListView) findViewById(R.id.SCHEDULE);
  
          ArrayList&lt;HashMap&lt;String, String&gt;&gt; mylist = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
          HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
          map.put("train", "101");
          map.put("from", "6:30 AM");
          map.put("to", "7:40 AM");
          mylist.add(map);
          map = new HashMap&lt;String, String&gt;();
          map.put("train", "103(x)");
          map.put("from", "6:35 AM");
          map.put("to", "7:45 AM");
          mylist.add(map);
           mSchedule = new SimpleAdapter(this, mylist, R.layout.row,
                      new String[] {"train", "from", "to"}, new int[] {R.id.TRAIN_CELL, R.id.FROM_CELL, R.id.TO_CELL});
          list.setAdapter(mSchedule);
  
          list.setOnItemClickListener(new OnItemClickListener() 
          {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) {
               Object o = list.getItemAtPosition(position);
              }
          });
      }
  }
  </code></pre>
  
  <p>and row.xml:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout
       xmlns:android="http://schemas.android.com/apk/res/android"
       android:paddingTop="4dip"
       android:paddingBottom="6dip"
       android:layout_width="fill_parent"
       android:layout_height="wrap_content"
       android:orientation="horizontal"&gt;
      &lt;CheckBox
          android:id="@+id/check"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:clickable="true"
          android:descendantFocusability="beforeDescendants"&gt;
      &lt;/CheckBox&gt;
       &lt;TextView android:id="@+id/TRAIN_CELL"
           android:layout_width="50dip"
           android:layout_height="wrap_content"/&gt;
  
       &lt;TextView android:id="@+id/FROM_CELL"
           android:layout_width="70dip"
           android:layout_height="wrap_content" android:layout_weight="1"/&gt;
  
       &lt;TextView android:id="@+id/TO_CELL"
           android:layout_width="60dip"
           android:layout_height="wrap_content"  android:layout_weight="1"/&gt;
  
              &lt;ImageView
          android:id="@+id/icon"
          android:layout_width="22px"
          android:layout_height="22px"
          android:layout_marginLeft="4px"
          android:layout_marginRight="10px"
          android:layout_marginTop="4px"
          android:src="@drawable/icon" &gt;
      &lt;/ImageView&gt;
  &lt;/LinearLayout&gt;
  </code></pre>