gpt4 book ai didi

android - 发送电子邮件 android 后转到其他 Activity

转载 作者:搜寻专家 更新时间:2023-11-01 09:10:55 25 4
gpt4 key购买 nike

我可以使用下面的代码发送邮件,但默认情况下,在单击发送电子邮件后,我将返回到我之前的 Activity 意味着我的发送电子邮件操作从那里触发,但我想在发送邮件之后导航到其他 Activity 意味着之后单击发送按钮我不想返回我以前的 Activity ..所以如何做同样的事情,。比 x 提前给我所有的响应者..希望我能在这里得到解决方案

我发送邮件的代码如下:

 Intent(android.content.Intent.ACTION_SENDTO);
emailIntent.setType("text/html");
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "testing email send.");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml("<b>this is html text in email body.</b>"));
startActivity(Intent.createChooser(emailIntent, "Email to Friend"));

在此代码中使用 startActivity(Intent.createChooser(emailIntent, "Email to Friend"));这是一个带有标题和正文的邮件页面,在写上“TO”(向谁发送邮件)并单击“发送邮件”后,我导航到我以前的 Activity ,但我想去其他 Activity ...

  **means how to handle button send on send email activity**

最佳答案

您可以使用 startActivityForResult(Intent, int requestCode) 开始电子邮件 Activity 方法,然后从 onActivityResult() 方法

发送(或实际上未发送)电子邮件后启动您希望显示的 Activity

关于android - 发送电子邮件 android 后转到其他 Activity ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8427672/

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