1. Check out our app, Forums for Android! Download and leave feedback here!

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

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

  1. lms5400

    lms5400 Member
    Thread Starter
    15

    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
    38

    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...