I am just use the code how to direct open Gmail m开发者_Go百科ail composer in android? Problem is that after sending the mail. A dialog box is open that show options of "Mail, Gmail, Bluetooth" I just want to avoid it. Do you have any suggestion?
I send e-mails with the following method. When it's called it opens a dialog that allows the user to edit the body and hit send. After sending the dialog is gone.
private void SendErrorMail( Context _context, String ErrorContent )
{
Intent sendIntent = new Intent(Intent.ACTION_SEND);
String subject = _context.getResources().getString( R.string.CrashReport_MailSubject );
String body = _context.getResources().getString( R.string.CrashReport_MailBody ) +
"\n\n"+
ErrorContent+
"\n\n";
sendIntent.putExtra(Intent.EXTRA_EMAIL, getEmailAddressees());
sendIntent.putExtra(Intent.EXTRA_TEXT, body);
sendIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
sendIntent.setType("message/rfc822");
_context.startActivity( Intent.createChooser(sendIntent, "Title:") );
}
精彩评论