Spinners populated from database not registering selection
<p>I'm having a problem implementing spinners and getting them to work the way I want.  I have one spinner containing state abbreviations that is populated from an array.  Depending on the state that the user selects, the application should perform a database query and populate the second spinner with locations of stores in the selected state.  </p>

<p>The first spinner works fine, performs the query successfully and populates the second spinner.  I want to get the value from the second spinner and display it in a toast message.  Here is where the problem occurs.  The second spinner is not registering clicks after it is initially filled.  </p>

<p>In the example below, the user selects RI from the first spinner.  The second spinner is populated and the first town in the spinner "COVENTRY" is shown in a toast message.  The problem comes in when I try to select other towns from the 2nd spinner...  although the towns are shown in the spinner, they aren't coming up in the toast message.  </p>

<pre><code>if (parent.getItemAtPosition(pos).toString().equals("RI")) {
            HDHelper hdtable = new HDHelper(getApplicationContext());
            hdtable.open();
            Cursor c = hdtable.fetchRI();
            if (c != null){
            SimpleCursorAdapter hdadapter1 = new SimpleCursorAdapter(getApplicationContext(),
                android.R.layout.simple_spinner_item, c, // Give the cursor to the list adapter
            new String[] {c.getColumnName(2)}, // Map the column in the HD database to...
            new int[] {android.R.id.text1}); // The view defined in the XML template
            hdadapter1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
            Spinner hdstoresspin = (Spinner) findViewById(R.id.hdstorespinner);
            hdstoresspin.setAdapter(hdadapter1);
            hdstoresspin.setOnItemSelectedListener(new MyOnItemSelectedListener());

            String text = c.getString(c.getColumnIndex(hdtable.KEY_STORENUMBER));

            Toast.makeText(parent.getContext(), text, Toast.LENGTH_LONG).show();

                }
            startManagingCursor(c); 
            hdtable.close();
        } 
</code></pre>

<p>Here is the relevant DBHelper section dealing with the above query:</p>

<pre><code>public Cursor fetchRI() {
    String RIquery = "SELECT * FROM HDStores WHERE state = 'RI' ORDER BY storenumber";
    return mDb.rawQuery(RIquery, null);
  }
</code></pre>

<p>UPDATE:  I actually think the <code>OnItemSelectedListener</code>is working properly.  It is registering clicks, but no matter which value I click on, only the first value is reflected in the toast message.  Again, any help would be greatly appreciated.  Thank you.</p>
