Inputstream with an image from a url (HTC phone - won't work)


Last Updated:

  1. lms5400

    lms5400 Member This Topic's Starter

    Joined:
    Apr 28, 2010
    Messages:
    15
    Likes Received:
    0
    try{
    URL aURL = new URL("some_valid_url.jpg");
    InputStream is = (InputStream)aURL.getContent();
    Drawable image = Drawable.createFromStream(is, "src");
    myButton.setImageDrawable(image);
    is.close();
    }
    ...


    All images tested so far work on the simulator and my htc g1 phone, but some won't work on my htc hero phone and no exceptions are thrown. I also tried bufferedinputstream with the same results. Some images work on my htc and some don't. could this be a jpg formatting issue or could I be missing something?
     

    Advertisement
  2. mkeath

    mkeath Well-Known Member

    Joined:
    May 14, 2010
    Messages:
    209
    Likes Received:
    15
    Have you tried debugging using eclipse's tools through USB debugging? It could or could not be the type of image you're using. Only way to find out is to try a png or gif or bmp image or something.
     

Share This Page

Loading...