简体   繁体   中英

How can I get a bike image url for glide?

I'm trying to load an image url into my ImageView using glide.

To do so, I need to pass in an image_url to glide from my database. I can't just use a drawable since I'm going to be storing the image_url in my database. I've tried several converters(image to image_url, so I can pass it into my db, then to glide), but the best I got was this https://ibb.co/3R07zVw which still didn't work with glide. Ideally, I'd like to get the URL of just the plain image itself.

So far I have something like this:

Glide.with(this)
                .asBitmap()
                .load(item.getImage_url())
                .into(itemImage);

where item.getImageUrl() corresponds to this link: https://ibb.co/3R07zVw .

Is there any way I can just get the plain link of a bike image(and other kinds of images) so that I can pass it into my db and then pass it into glide? Thanks.

It depends if have the images or you want to load online images. If you have the images then you can upload you images to ibb.co or imgur.com. After you upload them they give you embed links, It has bbcode which contains the url of the image in [img] tag, copy that url then it'll load image with glide. Like for the link you have shared, the direct image link is https://i.ibb.co/dmQrgXS/biko.jpg Other wise you can always get the image url by right clicking on the image and copy the image link.

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