android - 需要从邮件撰写页面返回到特定 Activity

标签 android

在此处输入代码我正在使用我的应用程序中的邮件撰写选项,即当我点击提交按钮时,我正在将用户导航到邮件撰写页面。 现在我想返回到任何一种情况下的特定 Activity 1- 成功完全发送。导航到 Activity 2 2- 在 Discard 上导航到 activity1

我该怎么做 代码如下

Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);

emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,new String[] { 

"sales@fastpkg.com"});

emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Placing an Order");

emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "This is a 

sample mail..");

emailIntent.setType("text/plain");

startActivity(Intent.createChooser(emailIntent, "Send mail client :"));

最佳答案

我想,如果你使用

startActivityForResult(Intent.createChooser(emailIntent, "Send mail client :"),RESULT_OK);

您始终可以导航到您的 Activity (位于当前 Activity 的 onActivityResult()),您从该 Activity 开始了上述 Activity 成功或者当您 <从开始的 Activity 中强>按返回键。

关于android - 需要从邮件撰写页面返回到特定 Activity ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10276322/

相关文章:

java - 如何将 getContentResolver().query 用于多个选择参数?

android - 使用 setMultiChoiceItems 的自定义对话框

java - 防止在fragment中的RecyclerView中滚动时FAB下降

android - Jellybean 上的 getExternalStorage() 和 MTP 行为

Java WebSocketClient 没有收到大尺寸的消息

android - 与 adb 的连接中断,并且尝试重新连接失败

android - 在抽屉导航中的项目列表上方添加图像

android - 如何在Android中设置listView项目之间的空间

java - 文件实用程序 : readLines and writeLines methods not found

java - 将按钮的图像设置为应用程序图标