I\'m using this sample code to populate the Spinner. Data is read from database. The selection displays correctly - in this case, it shows \"Green\" and \"Red\".
<
Qberticus,
Yes, you're right about the resource ID binding!!
However, if I started with android.R.layout.simple_spinner_dropdown_item, obviously the dropdown layout will show, but it is not pretty :-)
String[] from = new String[] { ProfileDbAdapter.COL_PROFILE_TITLE };
int[] to = new int[] { android.R.id.text1 }; // from simple_spinner_dropdown_item
SimpleCursorAdapter profilesAdapter = new SimpleCursorAdapter(this,
android.R.layout.simple_spinner_dropdown_item, profilesCursor, from, to);
spinnerColor.setAdapter(profilesAdapter);
But now If I started with simple_spinner_item first, then setDropDownViewResource
to simple_spinner_dropdown item, it now displays exactly what I'm looking for.
String[] from = new String[] { ProfileDbAdapter.COL_PROFILE_TITLE };
int[] to = new int[] { android.R.id.text1 }; // from simple_spinner_dropdown_item
SimpleCursorAdapter profilesAdapter = new SimpleCursorAdapter(this,
android.R.layout.simple_spinner_item, profilesCursor, from, to);
profilesAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinnerColor.setAdapter(profilesAdapter);
Thank you so much for your help.