我如何在Gmail中设置作曲家为默认的电子邮件地址从现场 [英] How can I set the default email adress for the from field in Gmail Composer
问题描述
虽然在开始的Gmail作曲的 com.google.android.gm.ComposeActivity 在我的应用程序,我可以使用意图参数EXTRA_EMAIL设置到的电子邮件地址。反正是有,可以设置从电子邮件地址ComposeActivity默认的,如果我有我的设备上有多个Gmail帐户?
While starting the Gmail Composer com.google.android.gm.ComposeActivity in my App, I can use the intent parameter EXTRA_EMAIL set the to email adress. Is there anyway that can set the default from email address for ComposeActivity if I have more than one Gmail account on my device?
Intent sendIntent = new Intent(android.content.Intent.ACTION_SEND);
sendIntent.setType("plain/text");
sendIntent.putExtra(Intent.EXTRA_TEXT, body);
sendIntent.putExtra(Intent.EXTRA_EMAIL, cc@gmail.com);
sendIntent.putExtra(Intent.EXTRA_BCC, "bcc@gmail.com");
sendIntent.putExtra(Intent.EXTRA_CC, "cc@gmail.com");
sendIntent.putExtra(Intent.?????, "from@gmail.com"); //Can we set the from email?
sendIntent.setPackage("com.google.android.gm");
startActivity(sendIntent);
感谢。
推荐答案
试试这个
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,aEmailList);
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, aEmailList);
和aEmailList是
字符串aEmailList [] = {user@host.com,user2@host.com};
and aEmailList is String aEmailList[] = { "user@host.com","user2@host.com" };
希望这会帮助你。
这篇关于我如何在Gmail中设置作曲家为默认的电子邮件地址从现场的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!