Android: How to use grantUriPermission to be able to create and send an email with a bitmap attachment

后端 未结 3 1092
心在旅途
心在旅途 2021-01-04 12:18

From within my application, I\'m trying to create an email that contains an image contained in a bitmap object.

private void sendEmailWithBitmapAttached(){ 
         


        
3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-04 12:51

    Try including this in your AndroidManifest.xml.

    
    

    On Android 6.0+ the permission must be granted by the user to the application otherwise this will throw the SecurityException.

    To do this go into Settings/Apps/[AppName]/Permissions and allow the Storage Permission.

提交回复
热议问题