title: Android how to get selected item from data driven spinner
body: <p>Newbie question. I'm using a SimleCursorAdapter to populate a spinner from an SQLite table, as shown in the Android dev docs:</p>
  
  <pre><code>Spinner list=(Spinner)findViewById(R.id.cboModel);        
  SimpleCursorAdapter ModelAdapter = new SimpleCursorAdapter(this,
     android.R.layout.simple_spinner_item, model,
     new String[] {"Drug"},       
     new int[] {android.R.id.text1});
  ModelAdapter.setDropDownViewResource(
          android.R.layout.simple_spinner_dropdown_item);
  list.setAdapter(ModelAdapter);
  list.setOnItemSelectedListener(onModelSelect);
  </code></pre>
  
  <p>I've set up a listener, but I can't figure out how to get the selected item text, it pulls up the SQLiteCursor, not the actual text in the spinner.</p>
  
  <pre><code>private AdapterView.OnItemSelectedListener 
      onModelSelect= new AdapterView.OnItemSelectedListener() {
          public void onItemSelected(AdapterView&lt;?&gt; 
              parent, View view, int position, long id) {
              ModelName = parent.getSelectedItem().toString(); 
              android.util.Log.w("OnItemSelect.cboModel", ModelName);     
          }
          public void onNothingSelected(AdapterView&lt;?&gt; arg0) {
              // TODO Auto-generated method stub          
          }       
  };
  </code></pre>
  
  <p>Google turns up the question on several message boards, but no answers, so it appears to be a common newbie question. It may be painfully obvious to some, but if you could point me in the right direction I would appreciate it. Thank you.</p>