title: BitmapFactory: Unable to decode stream: java.io.FileNotFoundException even when file IS actually there
body: <p>I'm creating a simple app to take a picture. this is my code</p>
  
  <pre><code>Button b1;
  ImageView iv;
  String TAG = "MAIN ACTIVITY";
  
  File photo;
  private Uri mImageUri;
  
  
  private File createTemporaryFile(String part, String ext) throws Exception {
  
  
      File externalStorageDirectory = Environment.getExternalStorageDirectory();
      File tempDir = new File(externalStorageDirectory + "/cameratest/");
      if (!tempDir.exists()) {
          tempDir.mkdir();
  
      }
      return File.createTempFile(part, ext, tempDir);
  }
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
  
      b1 = (Button) findViewById(R.id.button);
      iv = (ImageView) findViewById(R.id.imageView);
  
      b1.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
  
              Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
  
              try {
                  // place where to store camera taken picture
                  photo = createTemporaryFile("picture", ".jpg");
                  photo.delete();
              } catch (Exception e) {
                  Log.v(TAG, "Can't create file to take picture!");
                  Toast.makeText(getApplicationContext(), "Please check SD card! Image shot is impossible!",
                          Toast.LENGTH_SHORT).show();
  
              }
  
              mImageUri = Uri.fromFile(photo);
              intent.putExtra(MediaStore.EXTRA_OUTPUT, mImageUri);
  
              startActivityForResult(intent, 0);
          }
      });
  }
  
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      // TODO Auto-generated method stub
      super.onActivityResult(requestCode, resultCode, data);
  
  
      if (requestCode == 0 &amp;&amp; resultCode == RESULT_OK) {
  
  
  
          Log.d(TAG, mImageUri.toString());
          Bitmap bitmap = BitmapFactory.decodeFile(mImageUri.toString());
          iv.setImageBitmap(bitmap);
  
      }
  
  
  }
  </code></pre>
  
  <p>as you can see i've added <code>eLog.d(TAG, mImageUri.toString());</code> at the end and in the logcat (as well as the <code>FileNotFoundException</code>) i see this direcory:</p>
  
  <pre><code>03-27 00:43:30.498 30526-30526/myapplication.example.falcoleo.cameratest1 D/MAIN ACTIVITY: file:///storage/emulated/0/cameratest/picture459838058.jpg
  03-27 00:43:30.499 30526-30526/myapplication.example.falcoleo.cameratest1 E/BitmapFactory: Unable to decode stream: java.io.FileNotFoundException: file:/storage/emulated/0/cameratest/picture459838058.jpg: open failed: ENOENT (No such file or directory)
  </code></pre>
  
  <p>guess if this directory exists? 
  <strong>spoler alert</strong>, <a href="http://i.stack.imgur.com/gZFNe.png" rel="noreferrer">it does</a>. And it's not like the image is created after the <code>BitmapFactory.decodeFile</code>. I really do not understand what i'm doing wrong. Everything works fine except when it actually has to display the photo, then it just does not display it. just blank. Like WTF m8 i'm just trying to do my job no need to go crazy, you know.</p>