How to switch database string to drawable resource in Android?
<p>I have this codesnippet that gives me the fetched KEY_COLOR from database, and puts it at R.id.text_color for attachment in xml..</p>

<p>KEY_COLOR equals atm "Red" and "Blue".
I dont want "red" and "blue" i want images instead, a little dot. </p>

<pre><code>private void fillData() {
    Cursor notesCursor = mDbHelper.fetchAllNotes();
    startManagingCursor(notesCursor);

    // Create an array to specify the fields we want to display in the list (only TITLE)

    String[] from = new String[]{NotesDbAdapter.KEY_TITLE, NotesDbAdapter.KEY_COLOR};

    // and an array of the fields we want to bind those fields to (in this case just text1)

    int[] to = new int[]{R.id.text1, R.id.text_color};

    // Now create a simple cursor adapter and set it to display
    SimpleCursorAdapter notes =
        new SimpleCursorAdapter(this,
                R.layout.notes_row, notesCursor, from, to);
    setListAdapter(notes);

}
</code></pre>

<p>I simply want to change the outcome of NotesDbAdapter.KEY_COLOR to R.drawable.red_dot or blue_dot... But i cant figure ot how...</p>

<p>Do you understand? :/</p>
