title: Problem with checking all checkboxes
body: <p>I have 2 problems.  </p>
  
  <p>The 1st problem.<br>
  I have a CheckedTextView "Select All" item and a list of array items set in a adapter of MutipleChoice. I am current trying to set the state of all the checkboxes of the array items to true/false by selecting the CheckedTextView. It works but there's a bug. Such that when the last item of the array is true, the "SelectAll" to true will work, but if the last item of the array is false, it will uncheck all the items. What I want is even if any of the item's state is false, it will be set to true when the checkedtextview is selected to true.   </p>
  
  <p>The 2nd problem.<br>
  I can't seem to set the checkedtextview to true when all of the array item's state is true.</p>
  
  <p>Could it be that I'm doing it the wrong way? Help given would be appreciated..</p>
  
  <p>This is my method for the CheckedTextView "Select All"</p>
  
  <pre><code>private void markAll (Boolean state) {
  
      for (int i = 0; i &lt; lv.getCount(); i++) {
          lv.setItemChecked(i, state);
      }           
  }
  </code></pre>
  
  <p>This is the coding for checking of the states of the array items  </p>
  
  <pre><code>@Override
  protected void onListItemClick(ListView l, View v, int position, long id) {
      for(int i = 0; i &lt; lv.getCount(); i++) {
          //if even 1 of the item is false, the checkedtextview will be set to false
          if(lv.isItemChecked(i) == false) {
              ctv.setChecked(false);
          }
          //if all of the item is true, the checkedtextview will be set to true as well
          //the coding should be done in the if-else below, if i'm not wrong
          if(...) {
  
          }
      }
  }
  </code></pre>
  
  <p><strong>EDIT</strong><br>
  This is the new code for calling my method
          ctv.setOnClickListener(new View.OnClickListener() {</p>
  
  <pre><code>        public void onClick(View v) {
              // TODO Auto-generated method stub
              ctv.setClickable(true);
              if(ctv.isPressed() &amp;&amp; ctv.isChecked() == false) {
                  ctv.setChecked(true);
                  markAll(true);
              }
              else {
                  ctv.setChecked(false);
                  markAll(false);
              }
          }
      });
  </code></pre>
  
  <p>This is my xml code for the checkedtextview</p>
  
  <pre><code>    &lt;CheckedTextView
          android:id="@+id/checkedtext"
          android:layout_width="fill_parent"
          android:layout_height="?android:attr/listPreferredItemHeight"
          android:text="Select all"
          android:textAppearance="?android:attr/textAppearanceLarge"
          android:gravity="center_vertical"
          android:clickable="true"
          android:checkMark="?android:attr/listChoiceIndicatorMultiple"
          android:paddingLeft="6dip"
          android:paddingRight="6dip"/&gt;
  </code></pre>