0

I'm new here so thanks in advance for your comprehension.

my app is basically composed of a button and an ImageView, when I click on the button, an already define image must appear on the ImageView, here is my code :

Uri uri = Uri.parse("file:///storage/emulated/0/Download/image.jpg");
Intent it = new Intent(Intent.ACTION_GET_CONTENT, uri);
it.setType("image/*");
startActivity(it);
BitmapFactory.Options options = new BitmapFactory.Options();
options.inMutable = true;
InputStream inputStream = getContentResolver().openInputStream(uri);
Bitmap bm = BitmapFactory.decodeStream(inputStream, null, options);
image_view.setImageBitmap(bm);

I get an exception FileNotFoundException on the inputStream here : getContentResolver().openInputStream(uri);

I've been looking for a long time about this problem but couldn't find an accurate answer. Does my Uri is wrong ?

Jeff
  • 1

0 Answers0