I am trying to save bitmap as an image to the phone storage with MediaStore like this:
MediaStore.Images.Media.insertImage(contentResolver, bitmap, "title" , "description")
The image was not saved inside the device storage, I have checked on both emulator and physical devices.
What I did so far:
Checked that the bitmap that I am passing is my wanted bitmap:
For this, I have checked its value with the help of the debugger like this:
1) Put a breakpoint on the line that supposed to save the image and check what bitmap I am passing, the bitmap was the same bitmap that I wanted to save:
2) This is how the bitmap looks like:
Made sure that the permission for writing files to the external storage (the line below) was granted from the user
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Made sure that the image was not saved at the end of the gallery or in any other place inside the device storage
I know that I can probably save the image without using MediaStore as mentioned in this thread but I want to know what I am doing wrong here and why I can't save the bitmap as an image inside the device storage.
null
if the image failed to be stored * for any reason.* – Tamir Abutbul Sep 27 '19 at 15:11