Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto", "testemail@gmail.com", null)); startActivity(intent);
- /* Create the Intent */
- final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
- /* Fill it with Data */
- emailIntent.setType("plain/text");
- emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{"to@email.com"});
- emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject");
- emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Text");
- /* Send it off to the Activity-Chooser */
- context.startActivity(Intent.createChooser(emailIntent, "Send mail..."));
- Intent intent = new Intent(
- Intent.ACTION_SENDTO,
- Uri.parse("mailto:testemail@gmail.com")
- );
- startActivity(intent);
- ComponentName emailApp = intent.resolveActivity(getPackageManager());
- ComponentName unsupportedAction = ComponentName.unflattenFromString("com.android.fallback/.Fallback");
- boolean hasEmailApp = emailApp != null && !emailApp.equals(unsupportedAction);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement