1
這個有點奇怪,我的應用程序我使用StringBuilder來構建字符串來創建電子郵件。發送電子郵件(Android)時,StringBuilder中的選項卡不起作用!
現在我想要做的是發送電子郵件的部分文本標籤(文本將被轉移到Word文檔,這將節省大量的編輯)。
所以在我的代碼,我寫的代碼,包括標籤,例如:
message.append(component).append("\t\t\t\t\t\t\t\t\t\t\t\t").append(risk).append("\r\n");
我用下面的代碼來構建電子郵件:
private void sendEmail(String recipient, String subject, String message) {
try {
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("text/html");
emailIntent.setType("message/rfc822");
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
}
}
所以,當我在看發送之前的電子郵件,標籤似乎已經工作,但是當我收到電子郵件時,他們不在那裏。噓。
任何想法,爲什麼這可能是?
尼斯變通,但它是一個恥辱,沒有解決問題的方式。我會留下一點時間,看看有沒有人有任何其他想法,如果沒有,我會打勾你的答案。感謝您的迴應。 – Scamparelli 2013-02-09 12:01:30