title: How to set image source from SQLite in a ListView
body: <p>I've a Listview populated with data from a SQLite data base with this code:</p>
  
  <pre><code>String[] from = new String[]{manager.CN_NAME, manager.CN_COLORFRUTO};
  int[] to = new int[]{android.R.id.text1, android.R.id.text2};
  </code></pre>
  
  <p>Works great. But I also want to set the image source from the database.</p>
  
  <p>I've seen in a video that it could be done like this</p>
  
  <pre><code>String[] from = new String[]{manager.CN_NAME, manager.CN_COLORFRUTO, manager.CN_IMAGE};
  int[] to = new int[]{android.R.id.text1, android.R.id.text2, R.id.imageView2};
  </code></pre>
  
  <p>But as a result of doing this, the imageview doesn't show anything (not even the default @drawable/image that it is set in android:src="@drawable/image")</p>
  
  <p>I've searched a lot and tried many ways to do this, but nothing has worked to me.
  I've tried with setImageResource, but the imageview is in the layout "lista1" and this code works for another layout: setContentView(R.layout.activity_base);</p>
  
  <p>Here it is the whole code of the activity:</p>
  
  <pre><code>public class BaseActivity extends Activity implements View.OnClickListener {
  
  private DataBaseManager manager;
  Cursor cursor;
  
  private EditText etBuscar;
  private Cursor c;
  private ListView lista;
  private TextView tv;
  private ImageButton bt;
  private ImageView imageView;
  private SimpleCursorAdapter adapter;
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
  
      setContentView(R.layout.activity_base);
  
      manager = new DataBaseManager(this);
      lista = (ListView) findViewById(R.id.listView);
      tv = (TextView) findViewById(R.id.editText);
      bt = (ImageButton) findViewById(R.id.imageButton);
      bt.setOnClickListener(this);
  
      String[] from = new String[]{manager.CN_NAME, manager.CN_COLORFRUTO, manager.CN_IMAGE};
      int[] to = new int[]{android.R.id.text1, android.R.id.text2, R.id.imageView2};
  
      cursor = manager.cargarCursorFrutos();
      adapter = new SimpleCursorAdapter(this,R.layout.lista1,cursor,from,to,0);        
      lista.setAdapter(adapter);
      [...]
  </code></pre>
  
  <p>Edit:
  This is what R.layout.lista1 XML looks like:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:orientation="horizontal" &gt;
  
  &lt;ImageView
      android:id="@+id/imageView2"
      android:layout_width="80dp"
      android:layout_height="80dp"
      android:adjustViewBounds="true"
      android:scaleType="fitXY"
      android:contentDescription="Descripción del contenido de la imagen"
      android:src="@drawable/berries1"
  
      /&gt;
  
  
  
  &lt;LinearLayout
      android:layout_width="fill_parent"
      android:layout_height="match_parent"
      android:gravity="center"
      android:orientation="vertical" &gt;
  
      &lt;TextView
          android:id="@android:id/text1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Large Text"
          android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
      &lt;TextView
          android:id="@android:id/text2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Small Text"
          android:textAppearance="?android:attr/textAppearanceSmall" /&gt;
  
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>And this is R.layout.activity_base XML, which has a search edit text and a image button to search in the listview:</p>
  
  <pre><code>&lt;LinearLayout
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
  &lt;LinearLayout
      android:orientation="horizontal"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"&gt;
  
      &lt;EditText
          android:layout_width="275dp"
          android:layout_height="wrap_content"
          android:id="@+id/editText" /&gt;
  
      &lt;ImageButton
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:id="@+id/imageButton"
          android:layout_weight="1"
          android:src="@android:drawable/ic_menu_search" /&gt;
  
  &lt;/LinearLayout&gt;
  
  &lt;ListView
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:id="@+id/listView"
      android:layout_gravity="center_horizontal" /&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>Edit2:</strong>
  I've found something about ViewBinder. But I can't implement the examples I've seen. Any help would be appreciated.</p>