Android launches the default email client, with multiple attachments

Source: Internet
Author: User

Android launches the default email client, with multiple attachments

Currently, emails need to be sent in the developed app. Therefore, you need to call the android default email client and add multiple email attachments. Which component should I use to call the default client? What components are used to support emails with multiple attachments?

Which of the following is used?
(
Intent. ACTION_SEND,
Intent. ACTION_SENDTO,
Intent. ACTION_SEND_MULTIPLE ,...
)?

Solution

 

The following code can be found at the end of the android email source code

 

String subject =... String text =... ArrayList
 
  
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 ();} the above Code is useful from Android 4.0 to Android 4.3. in Android 4.4 (KitKat), the activity name has changed to com. android. email. activity. composeActivityEmail,
 


 

You can try it. I have never tried it...

 

 

Related Article

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.