简体   繁体   中英

How can I download image using Glide lib with volley response

I'm facing problem with glide image loading, currently I'm using the given code which I searched from stackoverflow, but not working with me,

Details : is volley response I have string url and below code I'm using but working in my condition, need help

@Override
                public void webServiceCompleted(JSONObject responseJson) {
                    Gson gson = new Gson();

                    message_model=gson.fromJson(responseJson.toString(),myModelClass.class);
                    String url= message_model.getMessage_image();
                    commonFuntions.mLoaderCancel(mContext);

                    Glide
                            .with(getApplicationContext())
                            .load(url)
                            .into(_ImageView);
                }

But after loading the screen remains blank, even I can't using placeholder for it.

The way you are trying to load your image url is correct, Problem is with the url of the image, append "http://" in the beginning of the response url and then try your original code again. It should work.

This is for load imageurl into imageview using glide.

library for glide : compile 'com.github.bumptech.glide:glide:3.7.0'

Glide.with(getApplicationContext()).load(Stringurl)
                    .thumbnail(0.5f)
                    .crossFade()
                    .diskCacheStrategy(DiskCacheStrategy.ALL)
                    .into(yourimageview);

but first check your response.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM