大家好我在我的虚拟主机上从java.lang.UnsupportedOperationException
加载我的图片时遇到了file manager
并且始终打印.showImageForEmptyUri(android.R.drawable.ic_dialog_alert)
UIL doesn't support scheme(protocol) by default [carkila.esy.es/upload/20160808114541.png]. You should implement this support yourself (BaseImageDownloader.getStreamFromOtherSource(...))
java.lang.UnsupportedOperationException: UIL doesn't support scheme(protocol) by default [carkila.esy.es/upload/20160808114541.png]. You should implement this support yourself (BaseImageDownloader.getStreamFromOtherSource(...))
at com.nostra13.universalimageloader.core.download.BaseImageDownloader.getStreamFromOtherSource(BaseImageDownloader.java:280)
at com.nostra13.universalimageloader.core.download.BaseImageDownloader.getStream(BaseImageDownloader.java:99)
at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.downloadImage(LoadAndDisplayImageTask.java:291)
at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.tryCacheImageOnDisk(LoadAndDisplayImageTask.java:274)
at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.tryLoadBitmap(LoadAndDisplayImageTask.java:230)
at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.run(LoadAndDisplayImageTask.java:136)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
这是我的UILConfig.java
public class UILConfig {
public static ImageLoaderConfiguration config (Context context){
final DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder()
.cacheInMemory(true)
.cacheOnDisk(true)
.showImageOnLoading(android.R.drawable.stat_sys_download)
.showImageForEmptyUri(android.R.drawable.ic_dialog_alert)
.showImageOnFail(android.R.drawable.stat_notify_error)
.considerExifParams(true)
.bitmapConfig(Bitmap.Config.RGB_565)
.imageScaleType(ImageScaleType.EXACTLY) //filled width
.postProcessor(new BitmapProcessor() {
@Override
public Bitmap process(Bitmap bmp) {
return Bitmap.createScaledBitmap(bmp,200,200,false);
}
})
.build();
File cacheDir = StorageUtils.getCacheDirectory(context);
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context)
.threadPriority(Thread.NORM_PRIORITY - 2) // default
.tasksProcessingOrder(QueueProcessingType.FIFO) // default
.denyCacheImageMultipleSizesInMemory()
.memoryCache(new LruMemoryCache(2 * 1024 * 1024))
.memoryCacheSize(2 * 1024 * 1024)
.memoryCacheSizePercentage(13) // default
.diskCache(new UnlimitedDiskCache(cacheDir)) // default
.diskCacheSize(50 * 1024 * 1024)
.diskCacheFileCount(100)
.diskCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default
.imageDownloader(new BaseImageDownloader(context)) // default
.defaultDisplayImageOptions(DisplayImageOptions.createSimple()) // default
.writeDebugLogs()
.defaultDisplayImageOptions(defaultOptions)
.build();
return config;
}
}
我如何加载图片。
dict.addDynamicImageField(R.id.ivImg, new StringExtractor<Cars>() {
@Override
public String getStringValue(Cars product, int position) {
return product.Image;
}
}, new DynamicImageLoader() {
@Override
public void loadImage(String url, ImageView imageView) {
ImageLoader.getInstance().displayImage(url, imageView); // Default options will be used
}
});
答案 0 :(得分:0)
网址carkila.esy.es/upload/20160808114541.png
不包含方案。试试http://carkila.esy.es/upload/20160808114541.png