Why Images.Media.insertImage return null

前端 未结 7 533
耶瑟儿~
耶瑟儿~ 2020-12-03 20:55

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

7条回答
  •  时光说笑
    2020-12-03 21:28

    I was executing MediaStore.Images.Media.insertImage before getting user permission to WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE which was causing a null path

    So make sure user has allowed for permission and then store image

提交回复
热议问题