3
如果圖像已被緩存,我不想下載圖像。我正在使用NOSTRA的ImageLoader庫。請告訴我是否有任何方法可以做到這一點。以下是該代碼: -ImageLoader - 如果圖像已被緩存,則不要下載圖像
DisplayImageOptions options = new DisplayImageOptions.Builder()
.showStubImage(R.drawable.ic_stub)
.showImageForEmptyUri(R.drawable.ic_sample)
.resetViewBeforeLoading()
.cacheInMemory()
.cacheOnDisc()
.imageScaleType(ImageScaleType.EXACTLY_STRETCHED)
.bitmapConfig(Bitmap.Config.ARGB_8888)
.build();
imageLoader.displayImage(url2.toString()
,thumbnail,options, new
ImageLoadingListener() {
@Override
public void onLoadingStarted() {
// progressBar.setVisibility(grid.VISIBLE);
// grid.notify();
}
@Override
public void onLoadingFailed(FailReason failReason) {
//progressBar.setVisibility(grid.GONE);
// grid.notify();
}
@Override
public void onLoadingComplete(Bitmap bitmap) {
// progressBar.setVisibility(grid.GONE);
// grid.notify();
}
@Override
public void onLoadingCancelled() {
// progressBar.setVisibility(grid.GONE);
//grid.notify();
}
});
顯示配置 – NOSTRA