tags:

views:

121

answers:

3

Hi all!

I'm having trouble displaying SOME images on my android app. Just normal display image from certain URL. Some images works, some just doesn't work. For instance try displaying this image from URL:

http://img191.imageshack.us/img191/7379/tronlegacys7i7wsjf.jpg

It doesn't work. Doesn't even work in emulator.

Could it be the EXIF info for the image is problematic? Can anyone try to see they are able to display that image on android app, and share the code/method to display that image on screen?

Thank you!

A: 

You will have no problems displayin that image in a webview

WebView myWebView = (WebView) findViewById(R.id.webview);                   
myWebView.loadUrl("http://img191.imageshack.us/img191/7379/tronlegacys7i7wsjf.jpg");

where are your image being displayed?

Jorgesys
A: 

Make sure you have <uses-permission android:name="android.permission.INTERNET" /> in your AndroidManifest.xml. What code are you using to load the image?

Ben L.
A: 

Hi Patrick,

I have the same problem sometimes. It's strange, in some cases, it can not read from the InputStream and the bitmap is null. Some other cases, it can read from the InputStream, but maybe not enough so the image can not be display. In those cases, you can try write this stream to a file first and then read it into bitmap. It will work. (though we need to do 2 steps)

Bino