title: Get Simple List Item Single Choice - Get Selected Item
body: <p>So, this might be a simple question, or I may be doing things totally off here, but here's what I have:</p>
  
  <pre><code>public class SetPrefsActivity extends ListActivity{
  @Override
  public void onCreate(Bundle savedInstanceState){
      super.onCreate(savedInstanceState);
      setContentView(R.layout.radiolist);
      ArrayList&lt;Hall&gt; listItems = new ArrayList&lt;Hall&gt;();
      ArrayAdapter&lt;Hall&gt; ar = new ArrayAdapter&lt;Hall&gt;(this, android.R.layout.simple_list_item_single_choice, listItems);
      setListAdapter(ar);
      ListView lv = getListView();
      lv.setTextFilterEnabled(true);
  
      lv.setOnItemClickListener(new OnItemClickListener()
      {
      boolean somethingChecked = false;
      int lastChecked;
         public void onItemClick(AdapterView arg0, View arg1, int arg2,
           long arg3) {
             if(somethingChecked){
                 ListView lv = (ListView) arg0;
                 TextView tv = (TextView) lv.getChildAt(lastChecked);
                 CheckedTextView cv = (CheckedTextView) tv;
                 cv.setChecked(false);
             }
             ListView lv = (ListView) arg0;
             TextView tv = (TextView) lv.getChildAt(arg2);
             CheckedTextView cv = (CheckedTextView) tv;
             if(!cv.isChecked())
             cv.setChecked(true);
             lastChecked = arg2;
             somethingChecked=true;
         }
      });
      new LoadListTask().execute(); //This loads Items into the List
  
      Button b = (Button) findViewById(R.id.savePrefBtn);
      b.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
  
              //IF SOMETHING IS SELECTED,
              //THEN UPDATE SHARED PREFERENCES
  
              Intent i = new Intent(SetPrefsActivity.this, SomeOtherActivity.class);
              startActivity(i);
              }
  
          }
      });
  }
  //other stuff to fill the arrayAdapter
  }
  </code></pre>
  
  <p>What I want to do, is:
  When someone clicks the button, it gets information from the listview and updates a shared preference according to the radio option that's selected. </p>
  
  <p>What I'm having trouble with is getting the index of the currently selected item. What is the best way to retrieve that information? Am I implementing the single choice list completely wrong?</p>
  
  <p>Thank You!</p>