mirror of
https://github.com/ethauvin/android-about-box.git
synced 2025-04-25 10:47:10 -07:00
Added footer to email body (Close #5)
This commit is contained in:
parent
0dea2c71e0
commit
690d7547f1
1 changed files with 16 additions and 2 deletions
|
@ -3,9 +3,13 @@ package com.eggheadgames.aboutbox.share;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import com.eggheadgames.aboutbox.AboutConfig;
|
import com.eggheadgames.aboutbox.AboutConfig;
|
||||||
|
|
||||||
|
import org.w3c.dom.Text;
|
||||||
|
|
||||||
public final class EmailUtil {
|
public final class EmailUtil {
|
||||||
|
|
||||||
private EmailUtil() {
|
private EmailUtil() {
|
||||||
|
@ -29,17 +33,27 @@ public final class EmailUtil {
|
||||||
default:
|
default:
|
||||||
emailSubject = config.emailSubject;
|
emailSubject = config.emailSubject;
|
||||||
}
|
}
|
||||||
|
String emailBody = config.emailBody;
|
||||||
|
if (TextUtils.isEmpty(emailBody)) {
|
||||||
|
String deviceInfo = "";
|
||||||
|
deviceInfo += "\n App version: " + config.version;
|
||||||
|
deviceInfo += "\n Android version: " + Build.VERSION.RELEASE + " (" + android.os.Build.VERSION.SDK_INT + ")";
|
||||||
|
deviceInfo += "\n OS version: " + System.getProperty("os.version") + " (" + android.os.Build.VERSION.INCREMENTAL + ")";
|
||||||
|
deviceInfo += "\n Device: " + android.os.Build.MODEL + " (" + android.os.Build.PRODUCT + ")";
|
||||||
|
|
||||||
|
emailBody = "Please type your question here: \n\n\n\n\n"
|
||||||
|
+ "---------------------------" + deviceInfo;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Intent emailIntent = new Intent(Intent.ACTION_SENDTO, mailto);
|
Intent emailIntent = new Intent(Intent.ACTION_SENDTO, mailto);
|
||||||
emailIntent.putExtra(Intent.EXTRA_SUBJECT, emailSubject);
|
emailIntent.putExtra(Intent.EXTRA_SUBJECT, emailSubject);
|
||||||
emailIntent.putExtra(Intent.EXTRA_TEXT, config.emailBody);
|
emailIntent.putExtra(Intent.EXTRA_TEXT, emailBody);
|
||||||
activity.startActivity(Intent.createChooser(emailIntent, "Send email..."));
|
activity.startActivity(Intent.createChooser(emailIntent, "Send email..."));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (config.analytics != null) {
|
if (config.analytics != null) {
|
||||||
config.analytics.logException(e, false);
|
config.analytics.logException(e, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue