I've searched Google for this, but have only found similar examples--not exactly what I need. I simply need to start messaging (SMS) and email intents from my app with their "to" fields already populated. So I need to send a number with the sms intent and an email address with the email intent. Any help would be appreciated.
+1
A:
For the e-mail part :
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] {"[email protected]"});
emailIntent.setType("text/plain");
startActivity(Intent.createChooser(emailIntent, "Send a mail ..."));
fedj
2010-08-10 21:23:19
You might also take a look to Intent.EXTRA_SUBJECT and Intent.EXTRA_TEXT to fill the e-mail
fedj
2010-08-10 21:28:36
And the same thing works with an `ACTION_SENDTO` and an `smsto:` `Uri`
CommonsWare
2010-08-10 21:32:00
Thanks for the helpful responses. I noticed one thing though--when doing the SMS intent, setType() shouldn't be used because it will make the app chooser say that no apps can perform the action.
oliverwhite
2010-08-13 05:51:12
Yep, setType is used to know if you want to send through E-mail, facebook, twitter, ...
fedj
2010-08-13 11:18:10