使用ImageLoaders
Glide
ImageView的ImageView的=(ImageView的)findViewById(R.id.my_image_view);
Glide.with(this).load("http://goo.gl/gEgYUd").into(imageView);
简单图像加载。检查您可以与听众一起使用它们的链接。
你还可以尝试:
picasso
Android-Universal-Image-Loader
编辑:作为OP说,他使用UIL。
]您应该使用图像感知。 你可以拥有自己的高缓存内存配置。
public void initializeImageLoader(final Context sContext) {
final ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(sContext)
.memoryCacheExtraOptions(480, 800) // default = device screen dimensions
.taskExecutor(AsyncTask.THREAD_POOL_EXECUTOR)
.taskExecutorForCachedImages(AsyncTask.THREAD_POOL_EXECUTOR)
.threadPoolSize(3) // default
.threadPriority(Thread.NORM_PRIORITY - 1) // default
.tasksProcessingOrder(QueueProcessingType.FIFO) // default
.denyCacheImageMultipleSizesInMemory()
.memoryCache(new UsingFreqLimitedMemoryCache(50 * 1024 * 1024)) // default
.memoryCacheSize(50 * 1024 * 1024)
.imageDownloader(new BaseImageDownloader(sContext)) // default
.defaultDisplayImageOptions(DisplayImageOptions.createSimple()) // default
.build();
ImageLoader.getInstance().init(config);
}
在获取实例之前使用此初始化。
initializeImageLoader(context); ImageLoader imageLoader = ImageLoader.getInstance();
设置装载机的选项。
final DisplayImageOptions options = new DisplayImageOptions.Builder()
.showImageOnLoading(R.drawable.loading)
.showImageForEmptyUri(R.drawable.noimage)
.showImageOnFail(R.drawable.noimage)
.resetViewBeforeLoading(false) //default
.bitmapConfig(Bitmap.Config.RGB_565)
.cacheInMemory(true)
.cacheOnDisk(false) //default
.build();
并将其设置为您的装载机:
final ImageAware imageAware = new ImageViewAware(viewHolder.thumbnailImageView, false);
imageLoader.displayImage(imageUrl, imageAware, options);
使用图像库,如壁画加载和缓存画面,供各位 – Breavyn