3

I am receiving images from a URL and they display on the emulator but when I use a device the default image is shown. Im not totally sure which part of the code you require so Ill add more on request:

pubImage = extras.getString("pubImage");

ImageView ivimage = (ImageView) findViewById(R.id.image);
try{
            ivimage.setImageDrawable(grabImageDrawableFromUrl(pubImage));
            Log.d(TAG, pubImage);   

        }catch(Exception e){
            e.printStackTrace();
        }

3 Answers 3

2

I use Prime for all of my image loading in Android. If you were using it then you would not have to worry about issues like this.

3
  • Nice Self Promotion :-).. tried using it now.. But find the image a lot more scaled down than needed.Is there a way to give out required height, width in the API..
    – Rasmus
    Jul 21, 2012 at 20:31
  • If your using the RemoteImageView then make sure to set it to whatever size you require, outside of that I have never seen any issues whatsoever. Jul 21, 2012 at 22:16
  • Thanks, +1 for the package.Looks good but just got an out of memory error. Let me try to work on that
    – Rasmus
    Jul 22, 2012 at 5:11
2

try this...

InputStream is = (InputStream) this.fetch(url);
Drawable d = Drawable.createFromStream(is, "src");
ivimage.setImageDrawable(drawable);

if you still not get solution then use Universal Image Loader

0

Look at the answer to this question, it seems as if you might be missing a few details, but perhaps you should paste grabImageDrawableFromUrl() either way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.