如何通过电子邮件意图发送托管PDF?

时间:2016-11-15 10:51:29

标签: android email pdf android-intent

我正在尝试发送通过电子邮件意图托管的pdf。

    Intent launchEmailClientIntent = new Intent(Intent.ACTION_SEND);
    launchEmailClientIntent.setType("application/pdf");
    launchEmailClientIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
    launchEmailClientIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
    launchEmailClientIntent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(template));
    launchEmailClientIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("http://www.axmag.com/download/pdfurl-guide.pdf"));
    this.startActivityForResult(Intent.createChooser(launchEmailClientIntent, ""), requestCode);

但是当邮件客户端打开时,它表示它不能附加空文件" 我做错了吗?

0 个答案:

没有答案