title: Can't display image with Imageview on Android
body: <p>In my <code>\drawable-mdpi</code> folder, I have an image named: <code>test.jpg</code></p>
  
  <p>In my <code>main.xml</code> file, in my LinearLayout section, I have:</p>
  
  <pre><code>&lt;ImageView 
     android:id="@+id/test_image"
     android:src="@drawable/test"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     /&gt;
  </code></pre>
  
  <p>In my src folder, I have only 1 file, <code>HelloAndroidActivity.java</code> with only the following method:</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
      ImageView image = new ImageView(this);
      image = (ImageView) findViewById(R.id.test_image);
      setContentView(image);
  }
  </code></pre>
  
  <p>This seems to be correct, yet whenever I try to run it, I get The application HelloAndroid (process xxxxx) has stopped unexpectedly. Please try again.</p>
  
  <p>The strange part is it previously did display the image, but now it won't and I don't know why.</p>
  
  <p>Also, when I comment out the ImageDisplay code, and replace it with TextDisplay code. i.e.</p>
  
  <pre><code>    TextView tv = new TextView(this);
      tv.setText("Does this work?");
      setContentView(tv);
  </code></pre>
  
  <p>It does display the text.</p>
  
  <p><strong>Edit:</strong> was asked to post logcat. <a href="http://pastebin.com/L781T70n" rel="nofollow">Link to pastebin</a>.</p>