I am making an android recipes application where i use a database. In database there is a column named\" \"images\", where i store the name of the file of t
You need to set the ViewBinder
of the adapter to set the image of the ImageView
to the value received from the DB.
esodaAdapter.setViewBinder(new SimpleCursorAdapter.ViewBinder() {
@Override
public boolean setViewValue (View view, Cursor cursor, int columnIndex){
if (view.getId() == R.id.imageView1) {
ImageView IV=(ImageView) view;
int resID = getApplicationContext().getResources().getIdentifier(cursor.getString(columnIndex), "drawable", getApplicationContext().getPackageName());
IV.setImageDrawable(getApplicationContext().getResources().getDrawable(resID));
return true;
}
return false;
}