title: Unable to decode stream java.io.FileNotFoundException in android?
body: <p>I am new to android and I am getting this error when I try to use <code>decodefile()</code>.</p>
  
  <p>Here is the code </p>
  
  <pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  
   if ((requestCode == PICK_FROM_GALLERY ) &amp;&amp; (resultCode == RESULT_OK) &amp;&amp;       (data != null)){
           selectedImageUri = data.getData( );
           Log.e("Path1", ""+selectedImageUri);
           path1 = selectedImageUri.getPath();
           file = new File(path1);
           path =file.getAbsolutePath();
           Log.e("Path2", file.getAbsolutePath());
  
           mImageView.setImageURI(selectedImageUri);
      }}
  
  protected void badButtonPressed() {
      final long startTime = SystemClock.uptimeMillis();
  
  
      BitmapFactory.Options options = new BitmapFactory.Options();
      // Part 1: Decode image
     &gt;&gt; Bitmap unscaledBitmap = BitmapFactory.decodeFile(path, options);
       imageHeight = options.outHeight;
       imageWidth = options.outWidth;
      Log.e("w", ""+imageWidth);
      Log.e("h", ""+imageHeight);
  </code></pre>
  
  <p>Please tell me my mistake.</p>