The app you are currently developing needs to send mail, so you need to call the Android default mail client and need to add multiple message attachments, which component should I call the default client? What components are used to support e-mail for multiple attachments?
By which of the following?
(
Intent.action_send,
Intent.action_sendto,
Intent.action_send_multiple, ...
)?
Processing methods
After the Android email source code, can be found at the end of the following code
?
123456789101112131415 |
String subject = ...
String text = ...
ArrayList<uri> attachments = ...
Intent intent =
new Intent(Intent.ACTION_SEND_MULTIPLE);
intent.putExtra(Intent.EXTRA_SUBJECT, subject);
intent.putExtra(Intent.EXTRA_TEXT, text);
intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, attachments);
intent.setClassName(com.android.email, com.android.email.activity.MessageCompose);
try {
startActivity(intent);
}
catch (ActivityNotFoundException anfe) {
anfe.printStackTrace();
}
上面的代码在 Android
4.0 到 Android
4.3
时好用的,在Android
4.4 (KitKat) 版本中,activity的名字已经变成了 com.android.email.activity.ComposeActivityEmail,
</uri>
|
A companion tour, a free dating site: www.jieberu.com
Push family, free tickets, scenic spots: www.tuituizu.com
Android startup default mail client, multi-attachment issue