title: Unable to save image from the directory using FileProvider
body: <p>I'm taking an photo with my device's camera using FileProvider but the image was not being saved in the directory or in any other directory. How do I fix the problem so that I can save the captured image in a directory?</p>
  
  <p>MainActivity.java</p>
  
  <pre><code>Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
          String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
  
   File storageDir = new File(Environment.getExternalStorageDirectory(), "Test-Folder");
  
          if (!storageDir.exists()) {
              storageDir.mkdirs();
          }
  
  File image = new File(storageDir, "QR_" + timeStamp + ".png");
  Uri photoUri = FileProvider.getUriForFile(MainActivity.this, "com.test", image);
  cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoUri);
  
  List&lt;ResolveInfo&gt; resInfoList =
                  getPackageManager()
                          .queryIntentActivities(cameraIntent, PackageManager.MATCH_DEFAULT_ONLY);
  
          for (ResolveInfo resolveInfo : resInfoList) {
              String packageName = resolveInfo.activityInfo.packageName;
              grantUriPermission(packageName, photoUri,
                      Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
  
          }
          startActivityForResult(cameraIntent, 1);
  </code></pre>
  
  <p>provider_paths.xml</p>
  
  <pre><code>&lt;paths xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
  &lt;external-path name="external_files" path="Test-Folder/"/&gt;
  
  &lt;/paths&gt;
  </code></pre>