ImageLoader UIL默认不支持scheme(协议)

时间:2015-09-30 10:52:39

标签: android

有人可以告诉我如何将实际设备图像文件夹的路径放在 imageLoader.getInstance()。displayImage(path,imageView,options); 。因为我使用sd卡图像路径传递参数但是UniversalImageLoader E / ImageLoader:UIL默认不支持scheme(协议)[/storage/emulated/0/classnkk_images/1_20150928163482053.png]。您应该自己实现此支持(BaseImageDownloader.getStreamFromOtherSource(...))

这是我的Logcat

9-30 08:46:28.731  25090-25123/? E/ImageLoader﹕ UIL doesn't support scheme(protocol) by default [/storage/emulated/0/classnkk_images/1_20150928163491042.png]. You should implement this support yourself (BaseImageDownloader.getStreamFromOtherSource(...))
    java.lang.UnsupportedOperationException: UIL doesn't support scheme(protocol) by default [/storage/emulated/0/classnkk_images/1_20150928163491042.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:818)
09-30 08:46:28.731  25090-25090/? E/sizeImgElement﹕ = 1_20150928163482053.png = 27021
09-30 08:46:28.740  25090-25090/? E/path﹕ = /storage/emulated/0/classnkk_images/1_20150928163482053.png
09-30 08:46:28.742  25090-25124/? E/ImageLoader﹕ UIL doesn't support scheme(protocol) by default [/storage/emulated/0/classnkk_images/1_20150928163482053.png]. You should implement this support yourself (BaseImageDownloader.getStreamFromOtherSource(...))
    java.lang.UnsupportedOperationException: UIL doesn't support scheme(protocol) by default [/storage/emulated/0/classnkk_images/1_20150928163482053.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:818)

1 个答案:

答案 0 :(得分:1)

使用file://方案,如the documentation

所示
"file:///mnt/sdcard/image.png" // from SD card