I have some code where I run the method MediaStore.Images.Media.insertImage (inserting it from a source not a file name), This code saves the image to the MediaStore and ret
When i had such a problem i fixed it with adding permissions: