Android 如何在Gmail Composer中设置发件人字段的默认电子邮件地址

Android 如何在Gmail Composer中设置发件人字段的默认电子邮件地址,android,gmail,Android,Gmail,在我的应用程序中启动Gmail Composercom.google.android.gm.ComposeActivity时,我可以使用intent参数EXTRA_EMAIL设置电子邮件地址。如果我的设备上有多个Gmail帐户,是否还有其他方法可以设置ComposeActivity的默认发件人电子邮件地址 Intent sendIntent = new Intent(android.content.Intent.ACTION_SEND); sendIntent.setType("

在我的应用程序中启动Gmail Composercom.google.android.gm.ComposeActivity时,我可以使用intent参数EXTRA_EMAIL设置电子邮件地址。如果我的设备上有多个Gmail帐户,是否还有其他方法可以设置ComposeActivity的默认发件人电子邮件地址

    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)

而这份名单是 字符串aEmailList[]={”user@host.com","user2@host.com" };

希望这对你有帮助