Checkbox state problem in ListView
<p>Hello with regard to the known issue of unwanted checkboxes being checked while scrolling through a listview, can anyone please give me an idea how to use a checkedTextView properly so that i can maintain check state properly when scrolling through the list. I thought the listview takes care of maintaining the checkbox state when using a checkedtextView but that does not seem to be the case. or do i have to use the default Id for the checkedTextView. I can't seem to find an example that uses a cursorAdapter or a SimpleCursorAdapter for this case. Thank you</p>

<p>i have tried using this, but am not really sure what to do with the set tag position. here is a small piece of code:</p>

<pre><code>  //bindView() method in SimpleCursorAdapter
 //viewHolder holder;
    //Cursor c;

    holder.checkedText = (CheckedTextView)view.findViewById(R.id.view_checked);
    holder.checkedText.setTag(c.getPosition());
        holder.checkedText.setOnClickListener(new View.OnClickListener() {
                        public void onClick(View v)
                        {
                              v.getTag();
                            ((CheckedTextView) v).toggle();
                        }
                    });
</code></pre>

<p>my xml standard layout:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"&gt;

    &lt;ListView android:id="@android:id/list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:choiceMode="multipleChoice"/&gt;

    &lt;TextView android:id="@android:id/empty"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/no_notes"/&gt;
&lt;/LinearLayout&gt;
</code></pre>

<p>my custom layout:</p>

<pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:orientation="horizontal"
  android:padding="6dp"&gt;

 &lt;LinearLayout
        android:orientation="vertical"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="2dp"&gt;

        &lt;TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="@string/viewNameText"
            android:id="@+id/viewNameId"&gt;
        &lt;/TextView&gt;

    &lt;/LinearLayout&gt;

    &lt;LinearLayout
        android:orientation="vertical"
        android:gravity="center_horizontal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1.0"
        android:padding="2dp"&gt;


        &lt;TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="start Date"
            android:layout_gravity="right"
            android:id="@+id/DateId"&gt;
        &lt;/TextView&gt;

        &lt;TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="start Time"
            android:layout_gravity="right"
            android:id="@+id/TimeId"&gt;
        &lt;/TextView&gt;
        &lt;/LinearLayout&gt;

        &lt;LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="right"
            &gt;



     &lt;CheckedTextView 
          android:id="@+id/title" 
          android:layout_width="fill_parent" 
          android:layout_height="wrap_content" 
          android:checked="false"
          android:focusable="false"
          android:clickable="true"
          android:textAppearance="?android:attr/textAppearanceLarge" 
          android:checkMark="?android:attr/listChoiceIndicatorMultiple" 
          /&gt; 

    &lt;/LinearLayout&gt;

 &lt;/LinearLayout&gt;        
</code></pre>
