问题描述
我正在发起邮件活动
//发送邮件
final int SENT_MAIL = 1;
startActivityForResult(Intent.createChooser(i,发送邮件"),SENT_MAIL);
startActivityForResult(Intent.createChooser(i,"Send mail"),SENT_MAIL);
并在
onActivityResult(int req, int res,Intent data)
我正在尝试查找电子邮件发送的结果,以确认我的邮件是被用户发送还是被用户丢弃.我收到的 Intent 数据为 null
i am trying to find the result of email sending, so as to confirm if my mail was sent or was discarded by the user.I am recieving null for Intent data
即数据 =null
onActivityResult(int req, int res, Intent data)中的参数,res始终为0.
parameter in onActivityResult(int req, int res, Intent data), res is always 0.
即.res = 0;
请告诉我在这种情况下可以做什么?
Please let me know what can be done in this case?
提前致谢!
推荐答案
你需要联系所有可能响应你的 Intent
(你没有在上面显示)的开发者并询问如果他们支持 startActivityForResult()
这样的 Intent
.可能性是,很少有人这样做,无论如何,您将很难追踪所有可能的 Android 电子邮件客户端.如果它们不支持 startActivityForResult()
,虽然您仍然可以调用该方法,但您将不会在 onActivityResult()
中获得有意义的结果.
You need to contact the developers of everything that could possibly ever respond to your Intent
(which you do not show above) and ask them if they support startActivityForResult()
for such an Intent
. Odds are, few do, and you will have difficult tracking down all possible Android email clients, anyway. If they do not support startActivityForResult()
, while you can still call that method, you will not get meaningful results in onActivityResult()
.
因此,恕我直言,您想要的是不切实际的.
Hence, what you want is impractical, IMHO.
这篇关于在 onActivityResult “Android"中获取邮件发送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!