避免 Android 应用程序中的后台处理

发布于 2024-11-25 18:17:40 字数 192 浏览 3 评论 0原文

我正在为一家公认的金融机构开发一个应用程序。对他们来说管理安全性非常重要,其中要求之一就是应用程序不能在后台运行。特别要求如果收到电话,则必须终止该应用程序。

我尝试使用 BroadcasterReceiver,在挂断电话时启动一个活动,但显然它作为服务运行,并且当我的应用程序不再运行时,该活动始终启动。 有什么办法可以像 iOS 一样避免后台处理吗?

I am developing an application for a recognized financial institution. It is very important for them to manage security, and one of the requirements is that the application cannot run in the background. It was specifically requested that if a phone call is received, the application must get killed.

I tried using BroadcasterReceiver, by starting an activity when I hang up a call but apparently it runs as a service, and while my application is no longer running the activity is always started.
Is there any way to avoid background processing, like in iOS?

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

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

发布评论

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

评论(1

2024-12-02 18:17:40

当您的 Activity 进入后台时,将调用 onPause()

如果您覆盖 onPause() 并停止其中的任何敏感活动,您总是会捕获进入后台的活动。

onPause() is called when your activity is going into the background.

If you overrode onPause() and stopped any sensitive activity in there, you would always catch the Activity going into the background.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文