我试图使用意图从我的应用程序发送电子邮件,但电子邮件的收件人字段将不会填充.如果我添加代码来填写主题或文本,它们工作正常.只有To字段不会填充.
我也尝试将类型更改为"text/plain"和"text/html",但我遇到了同样的问题.有人可以帮忙吗?
public void Email(){
Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.setType("message/rfc822"); //set the email recipient
String recipient = getString(R.string.IntegralEmailAddress);
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL , recipient);
//let the user choose what email client to use
startActivity(Intent.createChooser(emailIntent, "Send mail using...")); }
Run Code Online (Sandbox Code Playgroud)
我正在尝试使用的电子邮件客户端是Gmail