В вашем классе деятельности.
я есть проблема, касающаяся BitMapFactory.decodeFile.
В моем приложении я хочу, чтобы пользователь мог выбрать изображение со своего устройства или сделать фотографию. Это должно затем отображаться в ImageView
Вот фрагмент кода:
Uri selectedImage = data.getData();
String[] filePathColumn = {MediaStore.Images.Media.DATA};
Cursor cursor = getContentResolver().query(selectedImage, filePathColumn, null, null, null);
cursor.moveToFirst();
int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
String picturePath = cursor.getString(columnIndex);
cursor.close();
MyImage image = new MyImage();
image.setTitle("Test");
image.setDescription("test choose a photo from gallery and add it to " + "list view");
image.setDatetime(System.currentTimeMillis());
image.setPath(picturePath);
И я получаю это исключение:
BitmapFactory: Unable to decode stream: java.io.FileNotFoundException: /storage/emulated/0/WhatsApp/Media/WhatsApp Images/IMG-20170302-WA0012.jpg: open failed: EACCES (Permission denied)
Как решить это. Пожалуйста, помогите мне. Спасибо заранее ..