I have a requirement that I need to attach a ".zip" file and send the email using Gmail Service.
I am using below code to do this:
Intent intent = new Intent(Intent.ACTION_SEND); intent.setType(application/x-compressed); intent.putExtra(Intent.EXTRA_EMAIL, new String[]{abc@gmail.com}); intent.putExtra(Intent.EXTRA_STREAM, Uri.parse(abc.zip); intent.putExtra(Intent.EXTRA_TEXT, "hello.."); If I use the "application/x-compressed" mime type , I am able to send ".zip" attachments but I am unable launch Gmail composer directly, before that it is providing list of options.
If I use "message/rfc822" mime type, I am able to launch Gmail composer directly, but unable to attach ".zip" files.
Pl. help me to how to combine these two mime types in a single intent object. Pl. let me know if there's any alternative to do this. thanks.