title: How to retry image loading, if Glide fails?
body: <p>I am using this code to load the image from network.</p>
  
  <p>I am making multiple request at the same time due to which the error comes <code>FileNotFound</code> but the file actually exist on server.</p>
  
  <p>Therefore i want to ask that how can i retry the glide request if glide fails?</p>
  
  <pre><code> public static void LoadNetworkImage(final Context context, final ImageView imageView, final String imageUrl) {
  
          Glide.with(context).
                  load(imageUrl).
                  listener(new RequestListener&lt;Drawable&gt;() {
                      @Override
                      public boolean onLoadFailed(@Nullable GlideException e, Object model, Target&lt;Drawable&gt; target, boolean isFirstResource) {
  
                        //if loading fails then again make request
  
                          LoadNetworkImage(context,imageView,imageUrl);
                          return true;
                      }
  
                      @Override
                      public boolean onResourceReady(Drawable resource, Object model, Target&lt;Drawable&gt; target, DataSource dataSource, boolean isFirstResource) {
                          return false;
                      }
                  }).
                  into(imageView);
      }
  </code></pre>
  
  <p>i have studied this discussion <a href="https://github.com/bumptech/glide/issues/1307" rel="noreferrer">How to retry image loading ,if Glide fails?</a> but it did not help.</p>
  
  <p><strong>Error Logs</strong></p>
  
  <blockquote>
    <p>class com.bumptech.glide.load.engine.GlideException: Failed to load
    resource
        There was 1 cause:
        java.io.FileNotFoundException(No content provider: <a href="http://10.0.2.2:5000/image/tmpfhpbjdsf.png" rel="noreferrer">http://10.0.2.2:5000/image/tmpfhpbjdsf.png</a>)
         call GlideException#logRootCauses(String) for more detail
          Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetching data failed,
    class android.content.res.AssetFileDescriptor, LOCAL,
    DataCacheKey{sourceKey=<a href="http://10.0.2.2:5000/image/tmpfhpbjdsf.png" rel="noreferrer">http://10.0.2.2:5000/image/tmpfhpbjdsf.png</a>,
    signature=EmptySignature}
        There was 1 cause:
        java.io.FileNotFoundException(No content provider: <a href="http://10.0.2.2:5000/image/tmpfhpbjdsf.png" rel="noreferrer">http://10.0.2.2:5000/image/tmpfhpbjdsf.png</a>)
         call GlideException#logRootCauses(String) for more detail
            Cause (1 of 1): class java.io.FileNotFoundException: No content provider: <a href="http://10.0.2.2:5000/image/tmpfhpbjdsf.png" rel="noreferrer">http://10.0.2.2:5000/image/tmpfhpbjdsf.png</a> 07-30
    20:51:35.127 18903-18903/com.example.muhammadusman.project I/Glide:
    Root cause (1 of 1)
        java.io.FileNotFoundException: No content provider: <a href="http://10.0.2.2:5000/image/tmpfhpbjdsf.png" rel="noreferrer">http://10.0.2.2:5000/image/tmpfhpbjdsf.png</a>
            at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1396)
            at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1247)
            at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1170)
            at com.bumptech.glide.load.data.AssetFileDescriptorLocalUriFetcher.loadResource(AssetFileDescriptorLocalUriFetcher.java:22)
            at com.bumptech.glide.load.data.AssetFileDescriptorLocalUriFetcher.loadResource(AssetFileDescriptorLocalUriFetcher.java:13)
            at com.bumptech.glide.load.data.LocalUriFetcher.loadData(LocalUriFetcher.java:44)
            at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:62)
            at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:299)
            at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:269)
            at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:230)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
            at java.lang.Thread.run(Thread.java:764)
            at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:446)
    07-30 20:51:35.127 18903-18903/com.example.muhammadusman.project
    D/MyMessage: Again loading 07-30 20:51:37.842 1397-1397/?
    W/audio_hw_generic: Not supplying enough data to HAL, expected
    position 58480553 , only wrote 58327920 07-30 20:51:38.041
    18903-18903/com.example.muhammadusman.project W/Glide: Load failed for
    <a href="http://10.0.2.2:5000/image/tmpqklezoyk.png" rel="noreferrer">http://10.0.2.2:5000/image/tmpqklezoyk.png</a> with size [368x268]
        class com.bumptech.glide.load.engine.GlideException: Failed to load resource
        There was 1 cause:
        java.io.FileNotFoundException(No content provider: <a href="http://10.0.2.2:5000/image/tmpqklezoyk.png" rel="noreferrer">http://10.0.2.2:5000/image/tmpqklezoyk.png</a>)
         call GlideException#logRootCauses(String) for more detail
          Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetching data failed,
    class android.content.res.AssetFileDescriptor, LOCAL,
    DataCacheKey{sourceKey=<a href="http://10.0.2.2:5000/image/tmpqklezoyk.png" rel="noreferrer">http://10.0.2.2:5000/image/tmpqklezoyk.png</a>,
    signature=EmptySignature}
        There was 1 cause:
        java.io.FileNotFoundException(No content provider: <a href="http://10.0.2.2:5000/image/tmpqklezoyk.png" rel="noreferrer">http://10.0.2.2:5000/image/tmpqklezoyk.png</a>)
         call GlideException#logRootCauses(String) for more detail
            Cause (1 of 1): class java.io.FileNotFoundException: No content provider: <a href="http://10.0.2.2:5000/image/tmpqklezoyk.png" rel="noreferrer">http://10.0.2.2:5000/image/tmpqklezoyk.png</a> 07-30
    20:51:38.041 18903-18903/com.example.muhammadusman.project I/Glide:
    Root cause (1 of 1)
        java.io.FileNotFoundException: No content provider: <a href="http://10.0.2.2:5000/image/tmpqklezoyk.png" rel="noreferrer">http://10.0.2.2:5000/image/tmpqklezoyk.png</a>
            at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1396)
            at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1247)
            at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1170)
            at com.bumptech.glide.load.data.AssetFileDescriptorLocalUriFetcher.loadResource(AssetFileDescriptorLocalUriFetcher.java:22)
            at com.bumptech.glide.load.data.AssetFileDescriptorLocalUriFetcher.loadResource(AssetFileDescriptorLocalUriFetcher.java:13)
            at com.bumptech.glide.load.data.LocalUriFetcher.loadData(LocalUriFetcher.java:44)
            at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:62)
            at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:299)
            at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:269)
            at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:230)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
            at java.lang.Thread.run(Thread.java:764)</p>
  </blockquote>