I've seen this question asked before but it seems that the answer may be outdated.
I'm pulling a numeric value off of a spinner and storing it in a sqlite database as a string. I have an imageview placed into the row xml file. I'm sure creating some sort of adapter is involved.
How do i change the imageview source based on the value of the string from my database?
here is what i have now. the imageview src is static and the id is located in the xml layout.
``
private void fillData() {
String journalId = ((resource) this.getApplication()).getjournalId();
Cursor notesCursor = mDbHelper.fetchAllPlaces(journalId);
startManagingCursor(notesCursor);
String[] from = new String[]{journalDbAdapter.KEY_JOURNAL_NAME, journalDbAdapter.KEY_PLACE
, journalDbAdapter.KEY_DATE};
int[] to = new int[]{R.id.placedetail1, R.id.placedetail2, R.id.placedetail3};
SimpleCursorAdapter notes =
new SimpleCursorAdapter(this, R.layout.placedetailrow, notesCursor, from, to);
setListAdapter(notes);
}``
i have an additional field KEY_TEMP, it will have a value if a string (0 OR 1 OR 2 OR 3). i want to change the imageview src on each case.