Created
December 19, 2016 04:23
-
-
Save dingbuoyi/29a518dd2496f887b7fd3a1ae0b6502f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Intent emailIntent = new Intent(Intent.ACTION_SEND); | |
emailIntent.setType("message/rfc822"); | |
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{emailAddress}); | |
emailIntent.putExtra(Intent.EXTRA_SUBJECT, emailSubject); | |
emailIntent.putExtra(Intent.EXTRA_TEXT, emailContent); | |
if (emailIntent.resolveActivity(context.getPackageManager()) != null) { | |
context.startActivity(Intent.createChooser(emailIntent, "Send email ...")); | |
} else { | |
if (emailClientNotInstalledCallback != null) { | |
emailClientNotInstalledCallback.handle(); | |
} else { | |
Logger.e("no email client installed ! "); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment