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

后端 未结 3 1089
心在旅途
心在旅途 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:54

    I solved my issue by also adding permission flags to the intent, like this:

    intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
    

    More details can be found in documentation: https://developer.android.com/reference/android/support/v4/content/FileProvider.html#Permissions

提交回复
热议问题