Loading a floating point image using a redirect

I am trying to load image from url using glide. But the url is redirected to a different url and hence the image is not displayed.

Amazon s3 url and i am using glley integration

How can I deal with this redirect?

public class CustomCache implements GlideModule {
@Override
public void applyOptions(Context context, GlideBuilder builder) {
    try {
        builder.setDiskCache(
                new InternalCacheDiskCacheFactory(context, 41943040)
        );
    } catch (Exception e) {
        e.printStackTrace();
    }

}

@Override
public void registerComponents(Context context, final Glide glide) {
    RequestQueue queue = new RequestQueue( // params hardcoded from Volley.newRequestQueue()
            new DiskBasedCache(new File(context.getCacheDir(), "volley")),
            new BasicNetwork(new HurlStack())) {
        @Override public <T> Request<T> add(Request<T> request) {
            request.setRetryPolicy(new DefaultRetryPolicy(60000, 1, 1));

            return super.add(request);
        }
    };
    queue.start();
    glide.register(GlideUrl.class, InputStream.class, new VolleyUrlLoader.Factory(queue));
}


}

      

+3
android amazon-s3 android-volley android-glide


source to share


No one has answered this question yet

Check out similar questions:

1832
Lazy loading images in ListView
1207
Strange memory issue when loading image into Bitmap object
308
Picasso v / s Imageloader v / s Fresco vs Glide
156
How do I combine an image using the Glide library?
76
Progress bar while loading image with Glide
44
Loading an image using an app
4
HttpURLConnection sends POST request twice
0
Volleyball post request not working
0
How to call gridView adapter inside tab fragment
-2
Volley server error <! DOCTYPE HTML PUBLIC "- // IETF /, volley server error, JSONArray is not converted, upon upgrade, postman executing URL



All Articles
Loading...
X
Show
Funny
Dev
Pics