I am trying to put an image in an imageView by code. I have some images in the Drawable directory but, with other images, I have to use the internal storage. In first case,
holder.picture.setImageDrawable(getResources().getDrawable(R.drawable.my_image));
works but, in the second case, Android give me this error:
BitmapFactory: Unable to decode stream: java.io.FileNotFoundException: /storage/emulated/0/Sensia_Sniffer/18_04_2018/18_56_18_photo.JPEG (No such file or directory)
and I don't know why. I am using this lines:
Drawable drawable = Drawable.createFromPath(my_image_path);
holder.picture.setImageDrawable(drawable);
and in AndroidManifest.xml I have this permissions:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Could you help me with this?
Thank you very much!!!