title: Retrieving camera intent image full image uri
body: <p>I've found ways that have supposedly worked for people to retrieve the uri/bitmap of the camera taken image.
  But when I try and create a bitmap out of the non-null uri that I'm getting the file isn't created and doesn't exist.</p>
  
  <p>this the the function which I use to open the camera intent(Which is copied from stackoverflow):</p>
  
  <pre><code>private void openBackCamera() {
      String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
      String imageFileName = timeStamp + ".jpg";
      File storageDir = Environment.getExternalStoragePublicDirectory(
              Environment.DIRECTORY_PICTURES);
      currentImageBase64 = storageDir.getAbsolutePath() + "/" + imageFileName;
      File file = new File(currentImageBase64);
      Log.d("2","file 1: " +file.exists());
      Uri outputFileUri = FileProvider.getUriForFile(getApplicationContext(),"com.mydomain.fileprovider",file);
      currentImageBase64 =outputFileUri+"";
      Log.d("2",outputFileUri+" is the uri got from camera");
      Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
      cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
      startActivityForResult(cameraIntent, CAMERA_REQUEST);
  }
  </code></pre>
  
  <p>and this is how I handel my images:</p>
  
  <pre><code>            Log.d("2","camera request!"+ currentImageBase64);
              File imgFile = new  File(currentImageBase64);
              if(imgFile.exists()) {
                  Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());
  
                  ivPreview.setImageBitmap(myBitmap);
              }else{
                  Log.d("2","file does not exist");
              }
  </code></pre>
  
  <p>note that the camera request log shows that currentImagesBase64 is not null and has a value "content://com.mydomain.fileprovider/name/Pictures/20190121_173332.jpg"
  the file anyway, does not exist.</p>
  
  <p>/**
  edit: the problem was insufficent permissions, camera and read&amp;write permissions were requested and the problem was resolved!
  **/</p>