Search code examples
androidapiebay-api

get System.err: "java.net.UnknownHostException" while trying to load image


I'm making an app that uses the ebay api to list specific items. i got the api to work, it fetches the json which i parse. Every thing works except loading the image. I know the url is correct, you could try it yourself

http:\/\/thumbs1.ebaystatic.com\/pict\/390822678504404000000001_6.jpg

i tried various different image loader methods but they all give the same error: System.err: java.net.UnknownHostException: http://thumbs1.ebaystatic.com/pict/390822678504404000000001_6.jpg

any ideas thanks


Solution

  • use picasso

    Picasso.with(getApplicationContext())
    .load("http://thumbs1.ebaystatic.com/pict/390822678504404000000001_6.jpg")
    .fit()
    .centerInside()
    .into(yourImageView);
    

    Add the dependency:

    compile 'com.squareup.picasso:picasso:2.5.2'