gpt4 book ai didi

安卓 : how to open a mail composer view?

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:51:57 24 4
gpt4 key购买 nike

我只想知道如何在 Android 中打开 Mail Composer。

对于 iOS,我会做这样的事情:

MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init];
[controller setSubject:@"Mail subject"];
[controller setMessageBody:@"Mail body" isHTML:bool];
[controller setToRecipients:recipientsList];
if(controller) [self presentModalViewController:controller animated:YES];

Android 怎么样?

非常感谢。

最佳答案

Intent intent=new Intent(Intent.ACTION_SEND);
String[] recipients={"xyz@gmail.com"};
intent.putExtra(Intent.EXTRA_EMAIL, recipients);
intent.putExtra(Intent.EXTRA_SUBJECT,"abc");
intent.putExtra(Intent.EXTRA_TEXT,"def");
intent.putExtra(Intent.EXTRA_CC,"ghi");
intent.setType("text/html");
startActivity(Intent.createChooser(intent, "Send mail"));

关于安卓 : how to open a mail composer view?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11428670/

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