title: Check box not getting checked after clicking listview
body: <p>I have an activity where there is a list view having text view and a check box on the right. i want checkbox to be checked when the listview item is clicked. (Not on the checkbox). Like the one where android uses to check messages one by one to be deleted.</p>
  
  <p>Can anyone help me in resolving this? I switched off </p>
  
  <pre><code>android:focusable="false
  </code></pre>
  
  <p>and </p>
  
  <pre><code>android:focusableInTouchMode="false" 
  </code></pre>
  
  <p>on checkbox.</p>
  
  <p>Below is my list view item xml.</p>
  
  <pre><code>&lt;TextView
      android:id="@+id/textView2"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_alignParentTop="true"
      android:text="1."
      android:textAppearance="?android:attr/textAppearanceMedium"
      android:textColor="@android:color/white" /&gt;
  
  &lt;TextView
      android:id="@+id/textView1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentTop="true"
      android:layout_marginLeft="18dp"
      android:layout_toRightOf="@+id/textView2"
      android:text="Medium Text"
      android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
  &lt;CheckBox
      android:id="@+id/checkBox1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentRight="true"
      android:layout_below="@+id/textView1"
      android:layout_marginRight="22dp"
      android:layout_marginTop="-15dp" 
      android:focusable="false"
      android:focusableInTouchMode="false"/&gt;
  </code></pre>
  
  <p>And this is my code:</p>
  
  <pre><code>list.setOnItemClickListener(new OnItemClickListener() {
      @Override
      public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1,int arg2, long arg3) {
          // TODO Auto-generated method stub
          if(checkbox.isChecked())
              checkbox.setChecked(false);
  
          else
              checkbox.setChecked(true);
      }
  });
  </code></pre>