开发者

How to avoid Dialog box after sending mail from Gmail in Android?

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:") );
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜