title: Android setting images inside listView
body: <p>So i have this listview with my custom XML file that i made for it.</p>
  
  <p>In the file, there is an image with no source set that has a fixed id.</p>
  
  <p>I want to change this image source to one of my resources in drawable folder.</p>
  
  <p>Here is my XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:orientation="vertical" &gt;
  
  &lt;LinearLayout 
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:orientation="horizontal"
  &gt;
  &lt;ImageView 
   android:id="@+id/listImage"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:contentDescription="protection image"
   android:layout_marginTop="10dp"
  /&gt;
  &lt;LinearLayout 
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:orientation="vertical"
  android:layout_marginLeft="10dp"
  &gt;
  &lt;TextView android:id="@+id/text1" 
  android:textSize="20dp"  
  android:textStyle="bold"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"/&gt;
  &lt;TextView android:id="@+id/text2"
  android:textSize="12dp" 
  android:layout_marginTop="5dp"
  android:layout_width="wrap_content" 
  android:layout_height="fill_parent"/&gt;
  &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>This is what i have tried so far, and it crashes:</p>
  
  <pre><code>        adapter=new SimpleAdapter(this, listItems, R.layout.custom_row_view,new String[]{"name", "current"},  new int[] {R.id.text1, R.id.text2});
      ImageView img;
      img = (ImageView) findViewById(R.id.listImage);
      Drawable d = getResources().getDrawable(R.drawable.opened);
      img.setImageDrawable(d);
      setListAdapter(adapter);
  </code></pre>