Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Email Intent Not Sending Attached File

I have created an application that sends an email with a recording, When the intent is fired and email is chosen as the app to send the attachment, you can see that there is an attachment but the attachment is not delivered.

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..."));

Any ideas?

like image 911
shaneburgess Avatar asked Aug 29 '10 17:08

shaneburgess


1 Answers

I figured it out, you need to make sure that your uri has "file://" in front of it.

like image 117
shaneburgess Avatar answered Sep 27 '22 16:09

shaneburgess