E-mail attachment through intent using `mailto:` scheme
This seems to be fixed in API 17 (Jelly Bean 2), at least on my Galaxy Nexus and Nexus 4.
Specifically:
Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto", "email@me.com", null));
intent.putExtra(android.content.Intent.EXTRA_STREAM, Uri.fromFile(attachmentFile));
startActivity(Intent.createChooser(intent, "Send email..."));
This does NOT work in Froyo or Gingerbread. I'm not sure at what point it started working.
Maybe someone else has some details for other API levels?
I would suggest for pre-API17 using ACTION_SEND, otherwise ACTION_SENDTO.
Read more
stackoverflow.comm
No comments:
Post a Comment