1. Download our Official Android App: Forums for Android!

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

Discussion in 'Android Development' started by lms5400, Jun 17, 2010.

  1. lms5400

    lms5400 Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    15
    Joined:
    Apr 28, 2010

    Apr 28, 2010
    15
    0
    15
    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
    Rank:
    None
    Points:
    38
    Posts:
    209
    Joined:
    May 14, 2010

    May 14, 2010
    209
    15
    38
    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...