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...