Android: Can't get an image to download with the URLs

Avatar image for silmarilos
silmarilos

3

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

Hello all, I am retrieving image URLs from the server and they are appearing like this:

http:\/\/static.giantbomb.com\/uploads\/square_avatar\/8\/87790\/1814630-box_ff7.png

As a result, the android system does not understand it and when I try to make a call to download the image, it will not work. Does anyone have any idea how to make it so that I can actually download images and use them in something like an imageView?

Thanks!

-Sil

Avatar image for cloudymusic
cloudymusic

2203

Forum Posts

4877

Wiki Points

0

Followers

Reviews: 0

User Lists: 1

If that's your only problem, you should be able to do String.replace() or something similar to convert all instances of "\/" into "/".

Avatar image for silmarilos
silmarilos

3

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

@cloudymusic: That did indeed do it. Thanks! I ended up having to use the following:

private String formatTheBadURL(String icon_url) {

String return_url;

return_url = icon_url.replaceAll("\\\\", "");

Log.d("Formatted String", return_url);

return return_url;

}