Skip to content

Instantly share code, notes, and snippets.

@scruffyfox
Created April 13, 2012 11:57
Show Gist options
  • Save scruffyfox/2376347 to your computer and use it in GitHub Desktop.
Save scruffyfox/2376347 to your computer and use it in GitHub Desktop.
Launch email
MailTo mail = MailTo.parse(url.toString());
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("plain/text");
if (!StringUtils.isEmpty(website) && !StringUtils.isEmpty(email))
{
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{email + "@" + website});
}
intent.putExtra(Intent.EXTRA_SUBJECT, url.getQueryParameter("subject"));
intent.putExtra(Intent.EXTRA_TEXT, url.getQueryParameter("body"));
startActivity(intent);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment