SimpleCursorAdapter, как показать изображение?

Я делаю приложение рецептов Android, где я использую базу данных. В базе данных есть столбец с именем " "изображений"где я хранюимя файла картины рецепта, где я храню в папке drawable. Теперь я хочу составить список с рецептами, показывающий: 1) название рецепта 2) краткое описание и 3)образ рецепта Для этого я использую Simplecursoradaptor.

Моя проблема в том, что я не могу показать изображение.

Я хочу прочитать имя файла из столбца "изображений" и затем установите изображение в моем imageview (R.id.imageview1)

Вот мой код до сих пор:

public class RecipesMainActivity extends Activity 
{

public static final String ROW_ID = "row_id"; //Intent extra key
private ListView esodaListView;  // the ListActivity's ListView
private SimpleCursorAdapter esodaAdapter; // adapter for ListView
DatabaseConnector databaseConnector = new DatabaseConnector(RecipesMainActivity.this);


// called when the activity is first created
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_recipes_main);
    esodaListView = (ListView)findViewById(R.id.esodaList);
    esodaListView.setOnItemClickListener(viewEsodaListener);

    databaseConnector.open();

    // map each esoda to a TextView in the ListView layout
    // The desired columns to be bound
    String[] from = new String[] {"title","ingredients","image"}; // built an String array named "from"
    //The XML defined views which the data will be bound to
    int[] to = new int[] { R.id.esodaTextView, R.id.amountTextView, R.id.imageView1}; // built an int array named "to"
    // EsodaMainActivity.this = The context in which the ListView is running
    // R.layout.esoda_list_item = Id of the layout that is used to display each item in ListView
    // null = 
    // from = String array containing the column names to display
    // to = Int array containing the column names to display
    esodaAdapter = new SimpleCursorAdapter (this, R.layout.recipe_list_item, null, from, to);
    esodaListView.setAdapter(esodaAdapter); // set esodaView's adapter
} // end of onCreate method

@Override
protected void onResume()
{
    super.onResume(); // call super's onResume method

    // create new GetEsodaTask and execute it
    // GetEsodaTask is an AsyncTask object
    new GetEsodaTask().execute((Object[]) null);
} // end of onResume method

// onStop method is executed when the Activity is no longer visible to the user
@Override
protected void onStop()
{
    Cursor cursor= esodaAdapter.getCursor(); // gets current cursor from esodaAdapter

    if (cursor != null) 
        cursor.deactivate(); // deactivate cursor

    esodaAdapter.changeCursor(null); // adapter now has no cursor (removes the cursor from the CursorAdapter)
    super.onStop();
} // end of onStop method

// this class performs db query outside the GUI
private class GetEsodaTask extends AsyncTask
{
    // we create a new DatabaseConnector obj
    // EsodaMainActivity.this = Context
    DatabaseConnector databaseConnector = new DatabaseConnector(RecipesMainActivity.this);

    // perform the db access
    @Override
    protected Cursor doInBackground(Object... params)
    {
        databaseConnector.open();

        // get a cursor containing call esoda
        return databaseConnector.getAllEsoda(); 
        // the cursor returned by getAllContacts() is passed to method onPostExecute()
    } // end of doInBackground method

    // here we use the cursor returned from the doInBackground() method
    @Override
    protected void onPostExecute(Cursor result)
    {
        esodaAdapter.changeCursor(result); // set the adapter's Cursor
        databaseConnector.close();
    } // end of onPostExecute() method
} // end of GetEsodaTask class

Я много искал в Интернете, но не смог найти то, что могло бы мне помочь.

Могу ли я установить изображение в режиме просмотра изображений с помощью simplecursoradaptor или нет?

Должен ли я сделать пользовательский адаптер курсора? И если я должен сделать заказной, как я могу это сделать?

Ответы на вопрос(1)

Ваш ответ на вопрос