I’m using:
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
to send email, I need to add some footer to the message, is there any listener or some way that I can edit the message when user clicks “send”?
Thanks!
Edit:
below is the code I used:
private void sendEmail(String recipient, String subject, String message) {
try {
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("plain/text");
if (recipient != null) emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{recipient});
if (subject != null) emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
if (message != null) emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, message);
startActivity(Intent.createChooser(emailIntent, "Send mail..."));
} catch (ActivityNotFoundException e) {
// cannot send email for some reason
}
}
There is no field like:
android.content.Intent.EXTRA_EMAIL
which lets me supply information to the intent.
If the email is sent from your own app, then you will need to add the footer before firing the intent.
If the email is sent using any other app (including the default email app), then no, you won’t be able to modify it.
EDIT:
In the case above, you will just need to append the signature to the
messagestring, any time before the line