我的应用程序在后台data synchronization
中执行service
,这是应用程序的严重任务,以便正常工作。现在,应用程序运行良好&预期在一些具有纯Android
或接近纯Android
ROM的设备中。例如 Google Nexus , Android One & 摩托罗拉设备。但是,某些设备(如 Redmi MIUI )内置了阻止应用程序后台进程的选项。这导致我的应用程序工作不正常。所以,我想知道"有没有办法找出我的后台进程被阻止?这样我就可以通知用户取消阻止它。"
here's一个有点相关的问题
欢迎任何建议或帮助。
提前致谢
答案 0 :(得分:1)
据我所知,应用无法获取有关是否在白名单中的信息,但您可以通过以下方式通知用户: Intent intent = new Intent(); intent.setAction(" miui.intent.action.OP_AUTO_START&#34); intent.addCategory(Intent.CATEGORY_DEFAULT);