Reputation: 11951
I am not able to call a value or item from a DB to a spinner widgets.
I am trying this
SimpleCursorAdapter pharmacyDetailsAdapter = new SimpleCursorAdapter(this, R.layout.spinner_doc_pres_closed, PharmacydetailsCursor, from, to);
pharmacyDetailsAdapter.setDropDownViewResource(R.layout.appoint_pres_spinner);
pharmacyDetailsSpinner.setAdapter(pharmacyDetailsAdapter);
Upvotes: 0
Views: 461
Reputation: 369
Try below code..
Spinner spn = (Spinner) findViewById(resource_ID);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.SPNID, LIST);
spn.setAdapter(adapterVehicle);
spn.setSelection(POSITION);
You can set your spinner position.
Upvotes: 1