I want to send a mail with a zip file as attachment. I am able to
create zip file and I set the content type as "application/zip". But I
am getting a message saying "No applications can perform this action
Also, When I set the content type as "image/*" . It is opening the
mail compose window with zip file as attachment, but the mail is not
sending.
Pls find below the code I am using,
Intent sendIntent = new Intent(Intent.ACTION_SEND);
String subject = getResources().getString(R.string.emailSubject);
sendIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
String messageBody = "Body comes here";
sendIntent.putExtra(Intent.EXTRA_TEXT, messageBody);
String filesDirPath = getFilesDir().getAbsolutePath();
Uri uri = Uri.parse("file://"+filesDirPath+"/MYZIPFILE.zip");
sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
sendIntent.setType("application/zip"); //Content Type for zip file as
email Attachment.
startActivity(Intent.createChooser(sendIntent, getText
(R.string.app_name)));
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---