我用这个意图,让用户选择一张照片:`getContentResolver()openInputStream(URI)`抛出FileNotFoundException异常
Intent intent = new Intent(Intent.ACTION_PICK,
MediaStore.Images.Media.INTERNAL_CONTENT_URI);
startActivityForResult(intent, INTENT_SELECT_PHOTO);
而且在onActivityResult
:
Uri uri = data.getData();
InputStream inputStream = getContentResolver().openInputStream(uri);
但它在某些抛出FileNotFoundException
android设备。
的uri
值:
content://media/external/images/media/26467
引发的异常:
java.io.FileNotFoundException: No such file or directory
,这是非常奇怪的是,它不会抛出一些其他Android设备此异常。什么会导致这个错误,以及如何解决它?
我刚刚发现,因为实际的图像被删除,但它们在照片查看器应用程序中有缓存。 – Freewind
不知道,搜索问题,我遇到了一些解释相关问题的东西http://code.google.com/p/android/issues/detail?id=12508 – Shakti
Right Freewind,我有这个确切的代码/错误浏览我的.txt文件的下载文件夹以及下载位置,两者的大小相同,但其中一个没有。谢谢! – tom