title: How to Display a PNG from drawable Folder?
body: <p>I have been trying to display a PNG file in my activity with little success.</p>
  
  <p>I have a file named <code>arrow.png</code> in my <code>res/drawable</code> folder and my code is as follows:</p>
  
  <p><strong>XML:</strong></p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      tools:context=".Main" &gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@string/hello_world" /&gt;
  
      &lt;ImageView
          android:id="@+id/image"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_centerHorizontal="true"
          android:layout_centerVertical="true"
          android:src="@drawable/arrow" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>Java:</strong></p>
  
  <pre><code>public class Main extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          ImageView imgView = (ImageView) findViewById(R.id.image);
          imgView.setImageResource(R.drawable.arrow);
      }
  }
  </code></pre>
  
  <p>Of all the guides/examples I've read, they all gave me the same instructions as what I've created above. But when I run this program, there's nothing that shows up (the TextView displays just fine – image is nonexistent). I'm pretty baffled as to why this is happening, as there are no error messages.</p>
  
  <p>I've checked to see if the PNG file is corrupt, but that's also not the case. I've cleaned the project and restarted, but that still doesn't help. What am I missing/overlooking?</p>