title: Access non database item of an android list view
body: <p>I have list view that has two database elements displayed along with a checkbox element which will not be associated with database column.  I want to use checkbox to allow the user to select rows from the listview to be processed. </p>
  
  <p>I have created the following layout for the listView.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="?android:attr/listPreferredItemHeight"
      android:padding="6dip"&gt;
  
       &lt;CheckBox
          android:id="@+id/checkBox1"
          android:layout_width="wrap_content"
          android:layout_height="fill_parent"    
          android:layout_alignParentTop="true"
          android:layout_alignParentBottom="true"
          android:layout_marginRight="6dip" /&gt;
  
      &lt;TextView  
          android:id="@+id/dbCol1View"
  
          android:layout_width="fill_parent"
          android:layout_height="26dip" 
  
          android:layout_toRightOf="@id/checkBox1"
          android:layout_alignParentBottom="true"
          android:layout_alignParentRight="true"
  
          android:singleLine="true"
          android:ellipsize="marquee" /&gt;
  
      &lt;TextView
          android:id="@+id/dbCol2View"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
  
          android:layout_toRightOf="@id/checkBox1"
          android:layout_alignParentRight="true"
          android:layout_alignParentTop="true"
          android:layout_above="@id/dbCol1View"
          android:layout_alignWithParentIfMissing="true"
  
          android:gravity="center_vertical" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>I then have a database object as follows:</p>
  
  <pre><code>public class DbObj{
  private int id;
  private String dbCol1;
  private String dbCol2;
  
  
  public int getId() {
      return id;
  }
  public void setId(int id) {
      this.id = id;
  }
  public String getDbCol1() {
      return dbCol1;
  }
  public void setDbCol1(String dbCol1) {
      this.dbCol1 = dbCol1;
  }
  public String getDbCol2() {
      return dbCol2;
  }
  public void setDbCol2(String dbCol2) {
      this.dbCol2 = dbCol2;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I then use a SimpleCursorAdapter in my code as follows:</p>
  
  <pre><code>    String cols[] = { "dbCol1", "dbCol2" };
  int views[] = { R.id.dbCol1View, R.id.dbCol2View };
  cursor = dbObjDAO.getByCriteria(criteria);
  
  SimpleCursorAdapter ca = new SimpleCursorAdapter(rootActivity,
              R.layout.list_layout, cursor, cols, views);
  
  startManagingCursor(cursor);
  
  listView.setAdapter(ca);
  </code></pre>
  
  <p>The list shows up fine and the checkbox is there and can be selected. My question is how can I loop over the listView to find the items who's checkbox has been selected?</p>