-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple ImageLoader instances #92
Comments
First of all cache on disc/no cache is configured not in configuration but in display options for every displayImage(...) call. Ok, I understand your use case. public class AnotherImageLoader extends ImageLoader {
private volatile static AnotherImageLoader instance;
/** Returns singletone class instance */
public static AnotherImageLoader getInstance() {
if (instance == null) {
synchronized (ImageLoader.class) {
if (instance == null) {
instance = new AnotherImageLoader();
}
}
}
return instance;
}
} But be careful about sizes of memory caches (don't make summary caches size too big) and folders for disc caches (if you use limited disc caches then consider using different folders for caches). Changes will be available in new lib version. |
Thanks, at the moment I have got exactly the same solution, ImageLoader constructor is protected |
@nostra13 : the resolution helped me alot on this issue! Thank you for your answer. I had multitple use of UIL in my application from fragments to child fragments. |
You're welcome :) |
By the way I'd like to know why if the UIL not working if I am using 2 Activities with respective fragments with child fragments on the background. I declared it just the simple way for each of them. |
Thanks for this. One comment: shouldn't the synchronized block be on |
It seems so. |
In my app I have got 3 types of images to load, all of types needed different ImageLoaderConfiguration.
Images types example:
Sometimes it needed to use different ImageDownloader or FileNameGenerator or something else, but it is not possible at the moment because ImageLoader is singleton class.
So, what about many ImageLoader objects?
May be it will be good to use ImageLoaderFactory and class-containter for created ImageLoader objects to use them, or something else.
What do you think about it?
The text was updated successfully, but these errors were encountered: