I have 5 Spinners. In order to make it summary to this.
This is Spinner in xml
If your Spinner was populated by SQLite cursor, then the solution is:
Spinner mySpin = (Spinner) findViewById(R.id.myspin);
mySpin.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView> parent, View view, int position, long id) {
SQLiteCursor item = (SQLiteCursor) parent.getItemAtPosition(position);
String value = String.valueOf(item.getString(0));
Toast.makeText(getApplicationContext(), "The option is:" + value , Toast.LENGTH_SHORT).show();
}
PS: In item.getString(0) -> 0 is the index of column on cursor that you want to get.