Mattaku Betsujin wrote:
> I know I can specify an e-mail address using the Intent to invoke gmail.
> But how do I give it the initial content (and allow the user to edit the
> content if desired)?

Use the Intent.EXTRA_TEXT and Intent.EXTRA_SUBJECT constants in
something similar to:

String body = ...
String subject = ...
String[] mailto = { ... };
Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.setType("plain/text");
emailIntent.putExtra(Intent.EXTRA_EMAIL, mailto);
emailIntent.putExtra(Intent.EXTRA_TEXT, body);
emailIntent.putExtra(Intent.EXTRA_SUBJECT, subject);

context.startActivity(emailIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));

If you want to send a file attachment, also add:

emailIntent.putExtra(Intent.EXTRA_STREAM,
                        Uri.fromFile(logFile));



Best Regards,

Xavier Le Vourch

--
XLV Labs

Publisher of "Who Called?", Caller Id application for Android phones:

http://www.xlv-labs.com/whocalled

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to