Dear, I am uploading a Spinner
with information obtained from a table of database SQLite
of android, I have no problems in loading the Spinner
, but if at the time of obtaining the selected data and store it in another database table. This is the way I use to load the Spinner
. I would appreciate your guidance since I am new to Android. Thank you very much.
BaseDatos bd = new BaseDatos(getApplicationContext());
final Cursor c = bd.getReadableDatabase().rawQuery("SELECT id AS _id,nombre FROM Valores",null);
final SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,android.R.layout.simple_spinner_item,c,new String[]{"nombre"},new int[] {android.R.id.text1});
adapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
spValores.setAdapter(null);
spValores.setAdapter(adapter);