Android startup default mail client, multi-attachment issue

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.