完成电话通话后立即重新打开活动

发布于 2024-11-05 19:12:50 字数 103 浏览 6 评论 0原文

当我使用电话呼叫意图拨打电话并完成呼叫后,手机会打开呼叫日志,而不是直接重新打开启动呼叫意图的应用程序活动。

如何跳过通话记录?通话结束后,我希望手机返回到我的应用程序活动吗?

After I make a call with phone call intent and finish the call, the phone opens calls log instead of directly reopen the app activity which launches the call intent.

How do I skip going to the call log? After finishing the call I want the phone to come back to my app activity?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

喜爱皱眉﹌ 2024-11-12 19:12:50

启动/重新打开以前的活动并将标志 Intent.FLAG_ACTIVITY_SINGLE_TOP 设置为意图。
如果设置了此标志,则如果该活动已经在历史堆栈的顶部运行,则该活动将不会启动。

launch/reopen the previous activity and set flag Intent.FLAG_ACTIVITY_SINGLE_TOP to the intent.
if this flag set, the activity will not be launched if it is already running at the top of the history stack.

内心旳酸楚 2024-11-12 19:12:50

您可以观看 android.intent.action.PHONE_STATE 的广播以及额外的 EXTRA_STATE。如果是 EXTRA_STATE_IDLE 则调用已完成,您可以实现重新打开应用程序的逻辑

You can watch the Broadcast of android.intent.action.PHONE_STATE and for the extra EXTRA_STATE. If it is EXTRA_STATE_IDLE the call is finished and you can implement the logic to reopen your app

童话 2024-11-12 19:12:50

尝试重新打开应用程序,但应用程序崩溃

Intent i = new Intent("android.intent.action.MAIN");    
i.setComponent(new ComponentName("com.muaz", "HantarSMS") );
i.addCategory("android.intent.category.LAUNCHER");
startActivity(i);

Tried this to reopen app but the app crash

Intent i = new Intent("android.intent.action.MAIN");    
i.setComponent(new ComponentName("com.muaz", "HantarSMS") );
i.addCategory("android.intent.category.LAUNCHER");
startActivity(i);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文