我已经从我的应用程序启动了电子邮件活动..My问题是我如何知道电子邮件是否已发送
try {
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("text/html");
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,"Check out this play from http://www.iplaybook.net iPlayBook ");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,"This play was created using<a href='http://www.iplaybook.net'> iPlayBook.</a>");
final PackageManager pm = getPackageManager();
@SuppressWarnings("static-access")
final List<ResolveInfo> matches = pm.queryIntentActivities(emailIntent, pm.MATCH_DEFAULT_ONLY);
ResolveInfo best = null;
for (final ResolveInfo info : matches)
{
if (info.activityInfo.name.toLowerCase().contains("mail"))
best = info;
}
if (best != null)
{
emailIntent.setClassName(best.activityInfo.packageName, best.activityInfo.name);
startActivit(emailIntent);
}
}
catch(Exception e) { }
}请帮帮忙..
发布于 2012-04-18 16:29:09
你无法从android获得是否发送电子邮件的确认。根据设计,电子邮件的实际发送是异步的,因此活动很可能会在电子邮件实际发送之前返回。
Please search the questions in SO before posting a new one
干杯,RJ
https://stackoverflow.com/questions/10205309
复制相似问题