title: CursorAdapter breaks CHOICE_MODE_MULTIPLE option
body: <p>I have a <code>ListFragment</code>, where I add a <code>CursorAdapter</code> to my <code>ListView</code>, and I want to be able to click several rows, to use contextual action bar. I use SherlockActionbar, and it works fine, when I use a simple <code>ArrayAdapter</code>. But when I switch to <code>CursorAdapter</code>, it breaks. I cannot select multiple rows, only one. Any idea why it might happen?</p>
  
  <p>In <code>onActivityCreated</code> I set up the list:</p>
  
  <pre><code>@Override
  public void onActivityCreated(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      mActionMode = null;
      mListView = getListView();
      FinTracDatabase database = mDatabaseProvider.get();
      Cursor cursor = database.getTransactionCursor(false);
      mCursorAdapter = new TransactionListAdapter(getSherlockActivity(), cursor);
      mListView.setAdapter(mCursorAdapter);
      mListView.setItemsCanFocus(false);
      mListView.setOnItemClickListener(this);
      mListView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
  }
  </code></pre>
  
  <p>This is my <code>Adapter</code>:</p>
  
  <pre><code>private class TransactionListAdapter extends CursorAdapter {
  
      public TransactionListAdapter(Context context, Cursor cursor) {
          super(context, cursor, 0);
      }
  
      @Override
      public void bindView(View view, Context context, Cursor cursor) {
          bindToExistingView(view, cursor);
      }
  
      private void bindToExistingView(View view, Cursor cursor) {
          CheckedTextView amountView = (CheckedTextView) view;
          amountView.setText(cursor.getString(cursor.getColumnIndex(Transactions.TITLE)));
      }
  
      @Override
      public View newView(Context arg0, Cursor arg1, ViewGroup arg2) {
          LayoutInflater layoutInflater = getSherlockActivity().getLayoutInflater();
          View view = layoutInflater.inflate(android.R.layout.simple_list_item_multiple_choice, arg2, false);
          bindToExistingView(view, arg1);
          return view;
      }
  
  }
  </code></pre>
  
  <p>And finally the onClickListener:</p>
  
  <pre><code>@Override
  public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) {
      SparseBooleanArray checked = mListView.getCheckedItemPositions();
      boolean hasCheckedElement = true;
      for (int i = 0; i &lt; checked.size() &amp;&amp; !hasCheckedElement; i++) {
          hasCheckedElement = checked.valueAt(i);
      }
  
      if (hasCheckedElement) {
          if (mActionMode == null) {
              mActionMode = getSherlockActivity().startActionMode(new SelectingActionMode());
          }
      } else {
          if (mActionMode != null) {
              mActionMode.finish();
          }
      }
  }
  </code></pre>
  
  <p>If I switch my Adapter to a simple <code>ArrayAdapter</code>, it works fine. </p>
  
  <pre><code>new ArrayAdapter&lt;String&gt;(this,
              android.R.layout.simple_list_item_multiple_choice, new String[]{"A", "B", "C"})
  </code></pre>
  
  <p>I am hopeless, and I have no idea, why this is happening.</p>