title: FileProvider is very confusing
body: <p>I have an app in which I capture image and set it to the ImageView and then upload it to the server. But whenever I capture images the image is not getting displayed and when I try to upload the image I get FileNotFoundException as the path does not contain the image.</p>
  
  <pre><code>&lt;provider
          android:name="android.support.v4.content.FileProvider"
          android:authorities="com.example.android.imageuploader.provider"
          android:exported="false"
          android:grantUriPermissions="true"&gt;
          &lt;meta-data
              android:name="android.support.FILE_PROVIDER_PATHS"
              android:resource="@xml/file_paths" /&gt;
  &lt;/provider&gt;
  
  &lt;paths xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;external-path name="Image Uploader" path="Android/data/com.example.android.imageuploader/files/Pictures" /&gt;
  &lt;/paths&gt;
  </code></pre>
  
  <p>When i create image file I use this,</p>
  
  <pre><code>private File createImageFile() {
          String timeStamp = new SimpleDateFormat(
                  getString(R.string.time_stamp_format), Locale.getDefault())
                  .format(new Date());
          String fileName = getString(R.string.file_name_format, timeStamp);
          File storageDirectory =
                  new File(Environment.getExternalStoragePublicDirectory(
                          Environment.DIRECTORY_PICTURES), getString(R.string.app_name));
          if (!(storageDirectory.exists() || storageDirectory.mkdirs())) {
              Helper.showToastMessage(mContext, getString(R.string.warn_storage_dir));
          }
          return new File(storageDirectory.getPath() + File.separator + fileName);
      }
  </code></pre>
  
  <p>Actually I am saving the image in the internal storage directory 'Pictures' and in it I am creating folder after the app's name in which all the images are being saved. But while setting the image to the ImageView I am getting different file path say, </p>
  
  <pre><code>Image Uploader/Pictures/Image Uploader/20180406_101234.jpg
  </code></pre>
  
  <p>which is why the image is not being displayed as well as uploaded.</p>
  
  <p>Where I am going wrong I am not able to figure that out. Please help.</p>