So, I spent like a day pulling my hair out trying to load images from the web into an Android list view. Should be fairly straight forward right? I finally gave up and moved on to other screens to discover the same code worked on another screen! Something must be different here, I was thinking. The image sizes I’m downloading are smaller in the one that works. Maybe that has something do with it.
After some more searching I finally discovered this:
Note: a bug in the previous versions of
BitmapFactory.decodeStreammay prevent this code from working over a slow connection. Decode a newFlushedInputStream(inputStream)instead to fix the problem. Here is the implementation of this helper class:
The FlushedInputStream fixed everything! It was an Android bug, damnit.
So, the lesson of the day seems to be: Give Up!