我已经创建了一个应用程序发送带有录音的电子邮件,当意图被激发并选择电子邮件作为发送附件的应用程序时,您可以看到有一个附件,但附件未送达。Android的电子邮件意图不发送附件
Intent sendIntent = new Intent(Intent.ACTION_SEND);
//Mime type of the attachment (or) u can use sendIntent.setType("*/*")
sendIntent.setType("audio/3gp");
//Subject for the message or Email
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "My Recording");
//Full Path to the attachment
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(fileName));
//Use a chooser to decide whether email or mms
startActivity(Intent.createChooser(sendIntent, "Send email..."));
任何想法?
我已经有了一个图像相同的问题,甚至在开始时使用“file://”。希望你找到了另一种方法来使它工作? – skamlet 2012-03-11 14:49:37
我发现这个问题,我的文件是私人的,所以邮件应用程序无法读取文件。它现在工作正常 – skamlet 2012-03-11 17:11:48
@ D4r7h你是如何使你的文件“不私密”? 'file.SetReadable(true);'? 我也尝试将文件移动到〜文件夹,但没有运气。我有一个正确发送的txt文件。 你能给我一个提示,请问? – 2016-03-25 15:18:47