避免 Android 应用程序中的后台处理
我正在为一家公认的金融机构开发一个应用程序。对他们来说管理安全性非常重要,其中要求之一就是应用程序不能在后台运行。特别要求如果收到电话,则必须终止该应用程序。
我尝试使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您的 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.