My project uses the popular LazyAdapter with a listview to fetch remote images on scroll and cache them on the sdcard for later use.
Within another 'screen' of the app I am showing a mapfragment, I would like to display a related image within a CustomInfoWindow on a Google Map View. The idea is to fetch the images if necessary from the server, if the image has already been downloaded previously(either by the list of from the touch of the marker) then it gets it from the sdcard.
To use the ImageLoader with the ListView, you pass the imageview to the ImageLoader along with the remote url (in the adapter getView()) like this:
imageLoader.DisplayImage("http://urltomarkerpic.com" + pic
+ ".jpg", ((ImageView) view.findViewById(R.id.badge)));
I tried using this within the render() method of my custom info window class (which implements InfoWindowAdapter)and it does work, however the image loads only on the second press of each marker, the first press just shows the default jpg (as specified in the xml). Once the marker i touched again it loads the image from the sdcard (i have confirmed this with logcat).
It seemed intuitive to take this approach and after looking through LadyAdapters code I thought this would work. Has anyone else tried to do this and got it working? Or could anyone suggest an alternate method for reusing the ImageLoader (this will really save me bandwidth) within the InfoWindow whereby both the mapview and listview could utilize the lazy loading mechanism and keep downloading of imges to a minimum