setSelection on Spinner based on rowId
- by awiden
Hi!
I have a Spinner View that's populated through a SimpleCursorAdapter. Based on the selection I need to save the rowid in the entry database (position won't work because things can be added and deleted from the Spinner Database). This I can do by using spinner.getAdapter().getItemId(pos) . But When I edit an entry I need to make the Spinner position selected that is associated with this rowid (currently).
spinner.setSelection(position) won't work because I have the rowid, I need a way to find the current position of the item in the current spinner based on the rowid in the database.