public class EmailIntentSender extends Object implements org.acra.sender.ReportSender
The user will be asked to chose his preferred email client if no default is set. Included report fields can be defined using
AcraCore.reportContent(). Crash receiving mailbox has to be
defined with AcraMailSender.mailTo().
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_REPORT_FILENAME |
| Constructor and Description |
|---|
EmailIntentSender(org.acra.config.CoreConfiguration config) |
| Modifier and Type | Method and Description |
|---|---|
protected Intent |
buildAttachmentIntent(String subject,
String body,
ArrayList<Uri> attachments)
Builds an email intent with attachments
|
protected Intent |
buildResolveIntent(String subject,
String body)
Builds an intent used to resolve email clients and to send reports without attachments or as fallback if no attachments are supported
|
protected String |
buildSubject(Context context)
Creates the message subject
|
protected Uri |
createAttachmentFromString(Context context,
String name,
String content)
Creates a temporary file with the given content and name, to be used as an email attachment
|
protected boolean |
fillAttachmentList(Context context,
String reportText,
List<Uri> attachments)
Adds all attachment uris into the given list
|
void |
send(Context context,
org.acra.data.CrashReportData errorContent) |
public static final String DEFAULT_REPORT_FILENAME
public EmailIntentSender(@NonNull org.acra.config.CoreConfiguration config)
public void send(@NonNull Context context, @NonNull org.acra.data.CrashReportData errorContent) throws org.acra.sender.ReportSenderException
send in interface org.acra.sender.ReportSenderorg.acra.sender.ReportSenderException@NonNull protected Intent buildAttachmentIntent(@NonNull String subject, @Nullable String body, @NonNull ArrayList<Uri> attachments)
subject - the message subjectbody - the message bodyattachments - the attachments@NonNull protected Intent buildResolveIntent(@NonNull String subject, @NonNull String body)
subject - the message subjectbody - the message body@NonNull protected String buildSubject(@NonNull Context context)
context - a contextprotected boolean fillAttachmentList(@NonNull Context context, @NonNull String reportText, @NonNull List<Uri> attachments)
context - a contextreportText - the report contentattachments - the target list@Nullable protected Uri createAttachmentFromString(@NonNull Context context, @NonNull String name, @NonNull String content)
context - a contextname - the namecontent - the content