gpt4 book ai didi

email - 发送邮件 : Intent. EXTRA_EMAIL 不起作用

转载 作者:行者123 更新时间:2023-12-02 06:29:39 26 4
gpt4 key购买 nike

我没有收到任何错误,但不会显示邮件收件人!它保持空白

public void Send_Mail(View view) {
String txt_context = "My comment about the App : \n The App is good but does not support v3";
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setData(Uri.parse("mailto:"));
intent.setType("message/rfc822"); //
intent.putExtra(Intent.EXTRA_EMAIL,"receiver@gmail.com"); // **this will not displayed** """
intent.putExtra(Intent.EXTRA_SUBJECT,"Comment about the APP");
intent.putExtra(Intent.EXTRA_TEXT,txt_context);
startActivity(intent);

最佳答案

我知道这篇文章很旧,但我遇到了同样的问题,我找到了解决方案( in the official documentation ):

正如所解释的,Intent.EXTRA_EMAIL是:

A String[] holding e-mail addresses that should be delivered to.



因此,要解决您的问题,而不是:
intent.putExtra(Intent.EXTRA_EMAIL,"receiver@gmail.com");

做:
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"receiver@gmail.com"});

关于email - 发送邮件 : Intent. EXTRA_EMAIL 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42491652/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com