gpt4 book ai didi

android - UIL 默认不支持方案(协议(protocol)) 你应该自己实现这个支持

转载 作者:IT老高 更新时间:2023-10-28 22:25:29 26 4
gpt4 key购买 nike

您好,我正在从相机捕获图像并将其保存到 SDCARD 并通过 Universal Image Loader 加载,但每次我收到类似的错误

       09-20 14:38:22.617: E/ImageLoader(16626): 
UIL doesn't support scheme(protocol) by default [/mnt/sdcard/temp_photobooth.png]. You should implement this support yourself (BaseImageDownloader.getStreamFromOtherSource(...))



imgLoader.displayImage(Environment
.getExternalStorageDirectory().toString()
+ File.separator + Const.TEMP_FILE, choosen_image);

谁能帮我做点什么?

最佳答案

如果您从 SDCARD 加载图像,则应在路径前加上 file:///

String imageUri = "http://example.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)

所以你必须这样写:

imgLoader.displayImage("file:///"+Environment
.getExternalStorageDirectory().toString() + File.separator + Const.TEMP_FILE, choosen_image);

关于android - UIL 默认不支持方案(协议(protocol)) 你应该自己实现这个支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18912953/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com