Friday, July 19, 2013

[android help] E-mail attachment through intent using `mailto:` scheme


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

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...