Last active
April 1, 2016 16:50
-
-
Save talosdev/be915eb4c7c3f76f065f9b30cb332cc2 to your computer and use it in GitHub Desktop.
Intent chooser with only email programs included. https://developer.android.com/guide/components/intents-common.html#Email
This file contains 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
String subject = "Subject"; | |
String destinationEmail = "[email protected]"; | |
Intent intent = new Intent(Intent.ACTION_SENDTO); | |
intent.setData(Uri.parse("mailto:")); // only email apps should handle this | |
intent.putExtra(Intent.EXTRA_SUBJECT, subject); | |
intent.putExtra(Intent.EXTRA_EMAIL, destinationEmail); | |
Intent mailer = Intent.createChooser(intent, null); | |
startActivity(mailer); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment