oppo, vivo, mi android version 7.1.2 杀死后后台服务不重启 [英] Background Service is not restarting after killed in oppo, vivo, mi android version 7.1.2

查看:13
本文介绍了oppo, vivo, mi android version 7.1.2 杀死后后台服务不重启的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即使应用程序被终止,我也想在后台运行该服务.此功能在某些设备上运行良好.但是在 oppo、mi 和 Vivo 手机中,如果应用程序被杀死,它就不会运行.我该如何为这些设备执行此操作

I want to run the service in the background even if the app is killed. This functionality is working fine on some devices. But in oppo, mi and Vivo phone it's not running if the app is killed. how can I do this for these devices

推荐答案

  1. 我在 Oppo、Vivo、Mi 等手机上遇到了同样的问题,从最近的应用程序中删除后,应用程序被杀死,甚至服务也被杀死

  1. I had same issue with Oppo, Vivo, Mi and etc phones, after removing from recent applications app was getting killed even services was getting killed

解决方案:我添加了自动启动权限,例如 this 在我的应用程序中并且它起作用了.

Solution: I had add autostart permissions like this in my application and it worked.

解决此问题后,我的应用程序在后台运行一段时间后由于 DOZE 模式而被冻结/终止

After resolving this issue my app was getting frozen/killed after sometime running in background due to DOZE mode

解决方案:对于这种情况这个有效并且现在我的应用可以在任何设备的后台运行

Solution: for this condition this worked and now my app is working in background in any device

这篇关于oppo, vivo, mi android version 7.1.2 杀死后后台服务不重启的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆