title: Get all checked items from ListView
body: <p>If I have a <code>ListView</code> with the layout below where each item has a checkbox, how can I get all the checked items in the <code>onClick()</code> method when I click the <code>Button</code>?</p>
  
  <pre><code>&lt;RelativeLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="vertical"&gt;
  
          &lt;ListView
              android:id="@+id/listview"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              /&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;Button
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Submit"
          android:onClick="submitList"
          /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>The <code>onClick()</code> method:</p>
  
  <pre><code>public void submitList(View view) {
      //
  }
  </code></pre>