Android how to get selected item from data driven spinner?

Since the selected item is a Cursor, you can easily get the value by calling getString with the index of the column in the original database query that you used to populate the Spinner String spinnerString = null; Cursor cc = (Cursor)(yourSpinner.getSelectedItem()); if (cc! = null) { spinnerString = cc. GetString( cc.

GetColumnIndex("Drug"); } This technique definitely works when the Spinner is populated from the database. I have not tried it with a resource array.

Since the selected item is a Cursor, you can easily get the value by calling getString with the index of the column in the original database query that you used to populate the Spinner. String spinnerString = null; Cursor cc = (Cursor)(yourSpinner.getSelectedItem()); if (cc! = null) { spinnerString = cc.

GetString( cc. GetColumnIndex("Drug"); } This technique definitely works when the Spinner is populated from the database. I have not tried it with a resource array.

Figured it out... get the id, then make a DB query: String id_string = String. ValueOf(id); thismodel=Pkmodel. GetById(id_string, dbModel); ModelName=thismodel.getDrug().

New int {android.R.id. OnModelSelect= new AdapterView. Public void onItemSelected(AdapterView

Public void onNothingSelected(AdapterView

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions