Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/179.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android使用AQuery或毕加索显示SD卡上的图像_Android_Image_Android Sdcard - Fatal编程技术网

Android使用AQuery或毕加索显示SD卡上的图像

Android使用AQuery或毕加索显示SD卡上的图像,android,image,android-sdcard,Android,Image,Android Sdcard,也尝试过 message="file:///storage/sdcard0/My Folder/images/Camera_1415795981117.jpg"// image is available at this location Picasso.with(context).load( message+"") .into(holder.iv_message_image); 也试过 message="storage/sdcard0/Fre

也尝试过

message="file:///storage/sdcard0/My Folder/images/Camera_1415795981117.jpg"// image is available at this location

Picasso.with(context).load(  message+"")
                        .into(holder.iv_message_image);
也试过

message="storage/sdcard0/Fresh IM/images/Camera_1415795981117.jpg";
也试过用AQuery

message="file://storage/sdcard0/My Folder/images/Camera_1415795981117.jpg";
毕加索和阿奎里都正确地从url加载图像,但不是从本地加载,请帮助

使用毕加索-2.2.0 jar

提前感谢,,
Pragna

对于您的解决方案,这将有所帮助。要显示SD卡中的图像,首先需要将其转换为URI

aQuery.id(holder.iv_message_image).image(message)
                 .progress(R.id.pb_loading);

必须检查您的图像路径
消息
没有错误。

以下代码将非常有用,并确保当您想从SD卡加载图像时,正在加载文件

 Uri uri = Uri.fromFile(new File(message));
 Picasso.with(context).load(uri)
        .into(holder.iv_message_image);

让我们来看看./storage/sdcard0/My Folder/images/Camera_1415862492804.jpg String fileName=“Fresh IM/images/Camera_1415862492804.jpg”;System.out.println(“用户图像路径>>>>>>>>”+消息);Environment.getExternalStorageDirectory().getAbsolutePath();字符串img_path=baseDir+File.separator+fileName;实际上,它并没有加载到每个设备中,但您是否在日志中记录了该路径???是/storage/sdcard0/My Folder/images/Camera_1415862492804.jpg是logcat路径
Picasso.with(context).load(new File(path)).into(imageView);