我的应用程序具有后台服务,即使应用程序从任务管理器中被杀死,该后台服务仍可继续运行,但是当我在MI(小米)手机上测试了我的应用程序时,当我从任务管理器和服务中关闭该应用程序时,它会终止我的应用程序服务即使我从任务管理器中杀死了我的应用程序,仍然可以在MI以外的所有设备上继续运行并完美运行.
My app has background service which keep on running even if app is killed from the task manager but when I have tested my app on MI(xiaomi) phone it kills my app service when I close the app from task manager and my service keep on running and work perfectly on all devices except MI even if I kill my app from task manager.
那么,即使应用程序从任务管理器中被杀死,如何使我的服务在后台运行呢?
So how to keep my service running in background even when the app is killed from the task manager?
推荐答案MIUI具有内置的安全性"应用程序.在安全性"应用程序中,有一个自动启动"部分,用户可以在其中配置哪个应用程序在启动时可以运行,以及哪个应用程序不能在启动时运行.您的应用程序默认为禁用.您需要启用您的应用程序,还需要从权限部分启用权限管理器.
MIUI has a built-in Security app. In the Security app there is a 'Autostart' section, where the user can configure which app can and which app can't run on startup. Your application is disabled default. You need to enable your app and also enable permission manager from permission section.
更多推荐
即使从MI Phone的任务管理器中关闭了应用程序,如何保持我的应用程序服务保持运行
发布评论