【发布时间】:2013-04-11 21:42:48
【问题描述】:
我使用下面的代码向可能的电子邮件地址发送电子邮件。当我单击发送按钮时,有一个 toast msg 说 Message send...,但是我在代码中没有它。它必须是默认的。我的问题是,这是说要发送消息,但没有说明它已发送。我知道它是否到达无法检查,但应该有一条消息说它已发送。我希望它在未发送时显示错误,但用户不知道这一点。
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("text/plain");
i.putExtra(Intent.EXTRA_EMAIL , new String[]{"something@gmail.com"});
i.putExtra(Intent.EXTRA_SUBJECT, "subject of email");
i.putExtra(Intent.EXTRA_TEXT , "body of email");
try {
startActivity(Intent.createChooser(i, "Send mail..."));
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(About.this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
}
谢谢
【问题讨论】: