Quantcast
Channel: Unable to programmatically attach file to an email intent using a FileProvider - Stack Overflow
Viewing all articles
Browse latest Browse all 4

Answer by Louis CAD for Unable to programmatically attach file to an email intent using a FileProvider

$
0
0

If you also add it as ClipData, the permission grant will work successfully:

yourIntent.clipData = ClipData.newUri(context.contentResolver, fileName, contentUri)

The culprit is that Intent.FLAG_GRANT_READ_URI_PERMISSION will work only for Intent.data and Intent.clipData, and not for extras, unless the uri permission grant has been given explicitly (inconvenient), or has been given by also adding a ClipData.


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>