今天想利用本地图片资源的Uri来使用ImageLoader加载图片
结果报了这么一个错误:
You should implement this support yourself (BaseImageDownloader.getStreamFromOtherSource(...))
09-29 20:11:36.653 27465-27684/com.deltalab.urecommend E/ImageLoader: UIL doesn't support scheme(protocol) by default [/storage/sdcard/female.jpg]. You should implement this support yourself (BaseImageDownloader.getStreamFromOtherSource(...)) java.lang.UnsupportedOperationException: UIL doesn't support scheme(protocol) by default [/storage/sdcard/female.jpg]. 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)
在经过了一些博客的指点之后我总结了一下:
不同的路径有不同的方法,如果是在assets里,则在路径前加上“assets://”
还有以下情况:
String imageUri = "http://site.com/image.png"; // from Web String imageUri = "file:///mnt/sdcard/image.png"; // from SD card String imageUri = "content://media/external/audio/albumart/13"; // from content provider String imageUri = "assets://image.png"; // from assets String imageUri = "drawable://" + R.drawable.image; // from drawables (only images, non-9patch)
实例:
android如何获取一个SD卡指定文件夹的图片Uri:
String a="file://"+Environment.getExternalStorageDirectory().getPath()+"/DCIM/Camera/";
相关推荐
js js_leetcode题解之28-implement-strStr().js
在您提供的资源"matlab-implement[by faruto].rar"中,`faruto`对原始的`Libsvm`进行了改进,增加了几个优化算法,如遗传算法、粒子群优化以及网格搜索,这些扩展使得该库在解决复杂优化问题时更具优势。 1. **支持...
BloodHoud Tiny library for tracking screens and events with google analytics and / or firebase analytics. How to install repositories { maven { ... } } dependencies { ... implement "com.
这里为你收集整理了关于毕业设计、课程设计可参考借鉴的资料一份,质量非常高,如果你投入时间去研究几天相信肯定对你有很大的帮助。到时候你会回来感谢我的。 本资源是经过本地编译测试、可打开、可运行的项目、...
This application shows you how to implement professional looking scrolling credits. There are two different demos: top to bottom and left to right. You can click on the credited individual to send him...
Coordination Multi Point Transmission Reception for 2 Cells and One UE
在构建世界级的信息安全和数据安全体系时,身份与访问管理(IAM)扮演着至关重要的角色。IAM项目的目标是实现高效且低成本的业务流程,有效管理企业安全风险,并确保符合IAM的法规要求。以下是对IAM转型项目的详细...
This is a Demo for BottomNavigationView which make us easily to implement the bottom navigation bar. it releases at Android Support Library, revision 25.0.0. So you can add it in build.gradle: ...
Simple tool which help you to implement A/B Test. Download Comming soon. Code Preparation Prepare enum. enum ButtonColorPatterns { RED, GREEN, YELLOW } Build ABTest instance // Show button RED : ...
RSA密码芯片的FPGA实现 请有需要的人来下载
[]() []() Aurora IMUI 中文文档 Aurora IMUI is a general IM UI components, which is not depending on any specific IM SDK. This library provides common UI components ...With Aurora IMUI, you can implement
讲义+题目In this exercise, you will implement linear regression and get to see it work on data. Before starting on this programming exercise, we strongly recom- mend watching the video lectures and ...
If you implement the device which doesn't have standard ISA signals. Your CPU should simulate ISA signals. 4. The IOCHDRY signal only related to "read current register" (page1, 07h). 5. The other...
If you don't have this update, you should probably get it. SVN server used is VisualSVN, version 1.6.3. SVN windows client used is TortoiseSVN vesion 1.5.6, build 14908. SharpSVN version is 1.5005....
also learn the concept of swarm intelligence so that you can implement it in among robots. Appendix , Essential Hardware Components, covers mandatory hardware required for this book.
java java_leetcode题解之Implement Stack using Queues.java
java java_leetcode题解之Implement Stack Using Array.java