I were trying to attach images from Drawable to an email (from my app to Gmail app)
I have tried the next code:
Intent emailintent2 = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE);
emailintent2.setType("image/*");
emailintent2.putExtra(Intent.EXTRA_EMAIL, emailaddress2);
emailintent2.putExtra(Intent.EXTRA_SUBJECT, CorAsunto);
emailintent2.putExtra(Intent.EXTRA_TEXT, message2);
ArrayList<Uri> uris = new ArrayList<Uri>();
uris.add(Uri.parse("android.resource://" + getPackageName() + "/" + R.drawable.image1));
uris.add(Uri.parse("android.resource://" + getPackageName() + "/" + R.drawable.image2));
emailintent2.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
startActivity(emailintent2);
But when I attach the image to the email I get the attach without the extension ".png" and thats is a big problem.
So I think in try to convert this Drawable images to Bitmap and also I think that the ArrayList will have to be Bitmap. I think that I will get the image has image defined in the attachment.
If it is possible, can someone tell me how to do it? Convert to Bitmap, add to Arraylist and attach the image.
If I am wrong in all what I said, can someone give me a solution? I need to attach the images from Drawable to the email with the extension (.png).