When adding multiple blobs as attachments to an EmailDialog, only the last blob gets attached to the e-mail. And the last blob attached is duplicated in the e-mail for every previous blob attachment attempted to be added.
Steps to Reproduce:
- Set up an Android device with a working mail app.
- Build and run the below code on that device.
- Tap the "Send E-Mail" button.
The e-mail draft shows 2 image file attachments that are exactly the same when it shouldn't. They should be different images.
The e-mail draft should have 2 image file attachments.
- Screenshot of the entire Titanium app window.
- Screenshot of just the "Send E-Mail" button.
Write the blobs to file and attach the files instead.
Reason it Fails:
Titanium's "EmailDialogProxy" Java class writes all blobs to a temp file with the same file name, "attachment". So, each blob added overwrites the previous one in the temp directory.