title: Android: Unable to display png image in an ImageView
body: <p>I am writing an Android app that includes an ImageView.  The image to be included in the view resides on the local app directory of the emulator.  The image is not being displayed in the view.  The relavent XML and method used to display the image are given below.</p>
  
  <p>The image file is a "png" format file and is able to be opened from the local app directory.  The path returned by getFilesDir() includes the full path, "/data/data/net.vitalrecord.android/files."  This path designation does not exist on the development system but does exists when DDMS File Explorer is used.</p>
  
  <p>Any help with this problem is greatly appreciated.</p>
  
  <p>Thanks.</p>
  
  <p>LAYOUT XML:</p>
  
  <pre><code>&lt;AbsoluteLayout&gt;
  ......
  
  &lt;ImageView
   android:id="@+id/picture"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:layout_x="100px"
   android:layout_y="100px"/&gt;
  &lt;/AbsoluteLayout&gt;
  </code></pre>
  
  <p>Method:
  public void checkFilesExists() {</p>
  
  <pre><code>.....
  
  try {
   Context context = getApplicationContext();
   FILENAME = getString(R.string.MedicalImage);
   fis = openFileInput(FILENAME);
   int size = fis.available();
   byte[] buffer = new byte[size];
   fis.read(buffer);
   fis.close();
   setContentView(R.layout.medtogoimage);
      ImageView iv = (ImageView)findViewById(R.id.picture);
      String imagePath = context.getFilesDir() + "/" + FILENAME;
      Drawable d = Drawable.createFromPath(imagePath);
      iv.setImageDrawable(d);
      medtogo.setbMedicalImageFileExists(true);
  } catch (IOException e) {
    medtogo.setbMedicalImageFileExists(false);
  }
  </code></pre>