Android电子邮件意图不发送附加文件

sha*_*ess 5 email android attachment android-intent

我创建了一个发送带有录音的电子邮件的应用程序,当意图被触发并且选择电子邮件作为发送附件的应用程序时,您可以看到有附件但附件未送达.

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..."));
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

sha*_*ess 10

我想通了,你需要确保你的uri在它前面有"file://".