Back to project page socialcde4android.
The source code is released under:
MIT License
If you think the Android project socialcde4android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package it.uniba.socialcde4android.adapters; /*from w w w. j a va2 s . c o m*/ import it.uniba.socialcde4android.R; import android.content.Context; import com.nostra13.universalimageloader.core.DisplayImageOptions; import com.nostra13.universalimageloader.core.ImageLoader; import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; public class ConfiguratedImageLoader extends ImageLoader { private static ImageLoader imageloader; private static void newIstance(Context context){ imageloader = ImageLoader.getInstance(); if (!imageloader.isInited()){ DisplayImageOptions options = new DisplayImageOptions.Builder().cacheInMemory(true) .showImageOnLoading(R.drawable.user_default).build(); ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context) .defaultDisplayImageOptions(options).build(); imageloader.init(config); } } public static ImageLoader getImageLoader(Context context){ ConfiguratedImageLoader.newIstance(context); return imageloader; } public static void destroyIfImageLoader() { if (imageloader != null && imageloader.isInited()){ imageloader.destroy(); } } private ConfiguratedImageLoader(){ } }