返回到活动后的动作在Android中完成?

编程入门 行业动态 更新时间:2024-10-24 08:29:28
本文介绍了返回到活动后的动作在Android中完成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

当我启动SMS应用程序中使用下面的方法 - 一切正常,直到那里的邮件发送点。当我发送消息 - 它从来没有导航回原来的活动,除非我preSS后退按钮。我怎样才能启动SMS活动,然后一旦消息被送到了父活动再次显示?

这是我如何打电话与结果的短信应用程序。

字符串消息= getMessageString();     意图sendIntent =新的意图(Intent.ACTION_SENDTO);     sendIntent.setData(Uri.parse(短信:+号));     sendIntent.putExtra(sms_body,邮件);     startActivityForResult(sendIntent,INVITE_COMPLETED);

解决方案

这是可能的。只需要添加以下额外的你的意图:

sendIntent.putExtra(exit_on_sent,真正的);

When I start the SMS application using the following methods -- everything works fine up until the point where the message is sent. When I send the message -- it never navigates back to the original activity unless I press the back button. How can I start the SMS activity and then once the message is sent have the parent activity showed again?

This is how I call the SMS app with result.

String message = getMessageString(); Intent sendIntent = new Intent(Intent.ACTION_SENDTO); sendIntent.setData(Uri.parse("sms:" + number)); sendIntent.putExtra("sms_body", message); startActivityForResult(sendIntent, INVITE_COMPLETED);

解决方案

It is possible. Just need to add the following extra to your intent:

sendIntent.putExtra("exit_on_sent", true);

更多推荐

返回到活动后的动作在Android中完成?

本文发布于:2023-11-27 07:11:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1637089.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:动作   Android

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!