title: BitmapFactory: Unable to decode stream: java.io.FileNotFoundException
body: <p>I have a problem concerning the BitMapFactory.decodeFile.</p>
  
  <p>In my app, I want to user to be able to select an image from his/her device or take a photograph. This must then be displayed in an ImageView</p>
  
  <p>Here is code snippet:</p>
  
  <pre><code>Uri selectedImage = data.getData();
  String[] filePathColumn = {MediaStore.Images.Media.DATA};
  Cursor cursor = getContentResolver().query(selectedImage, filePathColumn, null, null, null);
                      cursor.moveToFirst();
                      int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
                      String picturePath = cursor.getString(columnIndex);
                      cursor.close();
                      MyImage image = new MyImage();
                      image.setTitle("Test");
                      image.setDescription("test choose a photo from gallery and add it to " + "list view");
                      image.setDatetime(System.currentTimeMillis());
                      image.setPath(picturePath); 
  </code></pre>
  
  <p>And I am getting this exception:</p>
  
  <pre><code>BitmapFactory: Unable to decode stream: java.io.FileNotFoundException: /storage/emulated/0/WhatsApp/Media/WhatsApp Images/IMG-20170302-WA0012.jpg: open failed: EACCES (Permission denied)
  </code></pre>
  
  <p>How to resolve it.Please help me.Thanks in advance..   </p>