You can clone with
HTTPS or Subversion.
I have an adapter that dynamically loads content when the bottom of the list is reached. I fetch new content and load the new items in the adapter and call notifyDataChanged().
This then causes a redraw of the view. When the view is redrawn the images must be reloaded from the ImageManager, which then fetches them from the cache. The causes about a 300ms delay. This in turn looks like the images flash. I am not sure how to overcome this.
Is there a way to have the images stored in RAM and fetch from there? I am using the LRU cache as well.
How are you using the imageLoader ... in the application class as in the documentation?
do you keep a static reference of it?
If you are using LRU cache you already have the images on the memory unless you have big images as they may take lots of memory...
not sure what is generating this 300ms of delay
is your app on the market?
you should set a nice default background image in the imageTag this can reduce the "flash"
I followed the documentation and haf the ImageLoader in the Application class as a static object. I also referenced the demo project that is posted.
The images I am using are about 50KB each. I have about 20 of them loaded into the manager. I think that should be an acceptable amount of memory. I am seeing this issue on my Galaxy Nexus and the emulator.
The app is still in development. I can send a link if needed.
if you have time will be great if you try to reproduce the issue in the demo project
maybe you can do something like :
1- copy one of the activity in the demo project
2- add a button or an option in the settings of the activity to trigger a notifyDataChanged
3- reproduce the update of the results of the list as you are doing it in your app
If the problem is affecting the demo project, make a pull request with a reference to this issue and I will look at it
ok I can see what you mean
I'm not completely sure I can improve that
the list is redraw and the image loader need to load the images once again
I will have a look if I can do something like skipping the loading of the background image if the image is in cache
But I need to investigate a bit ...
I'm having the same problem using an "endless" adapter.
@dwa012 have you found any workaround?
I have found a solution of sorts. I managed to get the image loader from the Google IO 2012 app to work. The loader in there does not have the flashing problem. I have been extremely busy and have not had a chance to try to merge the IO code with this project. I have linked the important parts below, in case someone else wishes to merge the code.
Link to source to include:
If no one picks it up, I may try to get it merged in after a few weeks, when I can get some free time.
use startAnimation instead of setAnimation, start on issue #54
more work on #54
8d0ca0b should fix the issue! Needs some more testing but notifydatasetchanged no longer causes a flash in the demo app at least
Sounds good. I will try to give it a shot in the next few days. Thanks for the hard work!