当服务位于前台时如何防止主应用程序终止?
我目前正在尝试重新制作我们公司已外包的应用程序。我们无法访问源代码,因此无法查看代码。我们的外包应用程序有一个在前台运行并带有通知的服务。当用户在打开的应用程序列表中关闭外包应用程序时(我不确定它叫什么),它并没有真正关闭。它的行为几乎就像是被最小化了一样。关闭后打开外包应用程序时,它会立即在上次关闭的位置打开,就像从未关闭过一样。甚至没有闪屏。它的行为就像它被恢复一样。
我已经能够按照 embarcadero 给出的示例 ForegroundLocationTracking
运行具有绑定和解除绑定的前台服务。尽管用户进入主屏幕或锁定手机,应用程序仍保持打开状态。当用户从打开的应用程序列表中终止该应用程序时,就会出现问题。应用程序现已终止,服务短暂终止,但系统再次启动。
我的想法是外包应用程序正在运行远程服务,但我不确定。
如何使应用程序具有与外包应用程序相同的行为?该服务将继续在前台运行。不得短暂终止并重新开始。主应用程序还必须像外包应用程序一样恢复或具有相同的行为。
I'm currently trying to remake our company app that has been outsourced. We do not have access to the source code so its not possible to look at the code. Our outsourced app has a service running in the foreground with a notification. When the outsourced app is closed by the user in the open app list (I'm unsure what it's called) it doesnt really close. Its behavior is almost like it's being minimized. When opening the outsourced app after closing it opens immediately right where it was last left off like it was never closed. Not even a splash screen. It's behavior is like its being resumed.
I've been able to run a foreground service with binding and unbinding following the sample ForegroundLocationTracking
embarcadero has given. The app stays open despite the user going to the home screen or locking the phone. The problem comes when the app gets terminated by the user from the open apps list. The app is now terminated and the service briefly gets terminated but gets started by the system again.
My thoughts are that the outsourced app is running a remote service however I'm unsure.
How can I make the app have the same behavior as the outsourced app? The service will keep running in the foreground. No briefly terminating and starting again. The main app must also just resume like the outsourced one does or have the same behaviour.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论