1, Send Email
1.1, Send Text
String[] mailto = { emailTo.getText().toString() };
// Create a new Intent to send messages
Intent sendIntent = new Intent(Intent.ACTION_SEND);
// Add attributes to the intent
sendIntent.putExtra(Intent.EXTRA_EMAIL, "Fill in target email address here!!!,eg:xxx@gmail.com");
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "Fill in email subject here!!!");
sendIntent.putExtra(Intent.EXTRA_TEXT, "Fill in email body here!!!");
sendIntent.setType("text/plain");
startActivity(Intent.createChooser(sendIntent, "MySendMail"))
1.2 Send Attachment
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.setType("audio/mp3");
sendIntent.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/mysong.mp3");
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "Subject");
startActivity(Intent.createChooser(sendIntent, "Title:"));
阅读(2606) | 评论(0) | 转发(0) |