views:

54

answers:

1

I have created an app 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 attachement 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?

A: 

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

dweebsonduty