我正嘗試使用send-me-logs向我發送包含日誌的電子郵件。我不想使用電子郵件客戶端,但只需「悄悄地」發送電子郵件。我也在我的應用程序中設置了android.permission.INTERNET。我使用此代碼:使用ACTION_SENDTO發送電子郵件始終失敗
Uri emailUri = Uri.parse("mailto:" + email);
StringBuilder sb = new StringBuilder(preface).append(LINE_SEPARATOR);
String phoneInfo = collectPhoneInfo();
sb.append(LINE_SEPARATOR).append(phoneInfo);
for (String line : lines)
sb.append(LINE_SEPARATOR).append(line);
String content = sb.toString();
Intent intent = new Intent(Intent.ACTION_SENDTO, emailUri);
intent.putExtra(Intent.EXTRA_SUBJECT, subject);
intent.putExtra(Intent.EXTRA_TEXT, content);
mContext.startActivity(intent);
startActivity不拋出異常,但我logcat的說:
08-21 16:30:22.418: ERROR/JavaBinder(9269): !!! FAILED BINDER TRANSACTION !!!
我是一個真正的設備(三星Galaxy S2)上。有任何想法嗎?
感謝您的提示,但它仍然不會工作... :-(我仍然得到相同的錯誤:失敗的BINDER TRANSACTION。 –