i've searched a lot but did not stumble upon something like i have to do. So when i click to send email file is shown as attached but i never receive attached file Is there some special way to send attachments that you receive as URL? Here is my activity code: http://pastebin.com/uzdJYxab[2] And here is my project https://docs.google.com/file/d/0B-91m-6ZevwCRTYtYXRGb3l6UVE/edit?usp=sharing Code for "Send email" button: sendEmail_button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent = new Intent(Intent.ACTION_SEND_MULTIPLE);
intent.setType("*/*");
intent.putExtra(Intent.EXTRA_SUBJECT, "Attachment from app");
intent.putExtra(Intent.EXTRA_TEXT, "Sending mp3 file " + title);
intent.putExtra(Intent.EXTRA_EMAIL, new String[] {"[email protected]"});
ArrayList<Uri> uris = new ArrayList<Uri>();
uris.add(Uri.fromFile(new File(trackUrl)));
intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
startActivity(Intent.createChooser(intent, "Send mail"));
}
});
Maybe there has to be some other way to put audio file from URL to intent? I do have to use intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uri); as a part of my task. However i skipped another part
ACTION_SEND_MULTIPLE would use external activity which should access sound file. To allow such access you need: - Create ContentProvider. - Override public ParcelFileDescriptor openFile(Uri uri, String mode)
Does this mean that only with a use of content provider can i get and put file from url as email attachment? I googled but did not find how to correctly override public ParcelFileDescriptor openFile(Uri uri, String mode), maybe someone will at least point me in right direction? Again i'm not asking to solve this, but at least point me out my mistakes and give some advise.