I use this intention so that the user can select a photo:
Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.INTERNAL_CONTENT_URI); startActivityForResult(intent, INTENT_SELECT_PHOTO);
And in onActivityResult :
Uri uri = data.getData(); InputStream inputStream = getContentResolver().openInputStream(uri);
But it throws a FileNotFoundException on some Android devices.
uri value:
content://media/external/images/media/26467
An exception:
java.io.FileNotFoundException: No such file or directory
And itโs very strange that it will not throw this exception on some other Android devices. What will cause this error and how to fix it?
source share