完成电话通话后立即重新打开活动
当我使用电话呼叫意图拨打电话并完成呼叫后,手机会打开呼叫日志,而不是直接重新打开启动呼叫意图的应用程序活动。
如何跳过通话记录?通话结束后,我希望手机返回到我的应用程序活动吗?
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
启动/重新打开以前的活动并将标志 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.
您可以观看 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
尝试重新打开应用程序,但应用程序崩溃
Tried this to reopen app but the app crash