title: Get row position in ListView with Checkbox in Android
body: <p>I am writing an android app, and I am having trouble getting a row's position in <code>ListView</code> with <code>CheckBox</code>.</p>
  
  <p>Here is a screenshot on the emulator:
  <img src="https://i.stack.imgur.com/mIvk1.png" alt="https://dl.dropbox.com/u/24223262/help.png"></p>
  
  <p>I already made the <code>ListView</code> with CheckBoxes.  But I can't figure out how find the row's position for each checked entry.  And once I get the checked positions, I want to implement a <em>Remove Selected</em> action.</p>
  
  <p>Please help!</p>
  
  <p>Here is my code:</p>
  
  <pre><code>public class ListTest extends ListActivity implements OnCheckedChangeListener {
      @Override 
      protected void onCreate(Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          super.onCreate(savedInstanceState);
  
          //--- Importing StringsArray---     
          Bundle gotBasketScanner = getIntent().getExtras();
          String[] StringArrayHistory = gotBasketScanner.getStringArray("fromHistory");
  
          // ---Make Adapter---
          setListAdapter( new ArrayAdapter&lt;String&gt;(ListTest.this,
                      android.R.layout.simple_list_item_multiple_choice,
                      StringArrayHistory));
  
          // ---Put Array into a ListView and add Checkboxes to Listview
          ListView list = getListView();
          list.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
      }
  }
  </code></pre>