错误:
E/BitmapFactory﹕ Unable to decode stream: java.io.FileNotFoundException: /file:/storage/sdcard0/Pictures/JPEG_20140728_190726_1641148246.jpg: open failed: ENOENT (No such file or directory)但我可以在F:\Pictures\JPEG_20140728_190726_1641148246.jpg (移动存储)中看到文件
我正在使用来自Taking Photos Simply | Android Developers的方法,但是如果你需要查看代码,我可以复制到这里
我还添加了权限:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />所有我想要的是使用相机拍摄意图,保存图像,保存到数据库的路径,然后在地图上显示它…
android 4.4.2 (CM)上的即时消息测试
发布于 2015-08-06 22:57:51
在您的示例中:
mCurrentPhotoPath = "file:" + image.getAbsolutePath();只需尝试使用:
mCurrentPhotoPath = image.getAbsolutePath();发布于 2014-07-29 01:49:02
你试过了吗?
new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + "/JPEG_20140728_190726_1641148246.jpg");而不是?
发布于 2014-10-27 22:12:06
我不知道为什么会存在这个问题,但我想出了如何避免它。尝试更改:
Bitmap bitmap = BitmapFactory.decodeFile(file.getAbsolutePath()); 至
try {
InputStream is = new FileInputStream(file);
Bitmap bitmap = BitmapFactory.decodeStream(is);
} catch (FileNotFoundException e) { } 它将会毫无问题地工作。
PS。我看了同样的android开发指南,也面临着和你一样的问题。
https://stackoverflow.com/questions/25001074
复制相似问题