我已经有很多关于该主题的帖子,其中一些作品,但仅在某些设备上.例如,它可以在带有cyaogenmod的Nexus 4,Nexus 5上运行,但不能在我的Xiaomi Mi2s(果冻束4.1.1)上运行
I have already red many posts about the subject, some of these works, but only on some devices. For example it works on my Nexus 4, Nexus 5 with cyaogenmod, but not on my Xiaomi Mi2s (jelly beam 4.1.1)
我尝试将其设置为粘滞状态,使用警报,并在销毁时广播接收器.但是他们俩都没有解决.当我终止该应用程序时,它再也不会唤醒.但是在同一台设备上,Whatsapp可以完美运行,即使我将其杀死,它也会再次唤醒.
I tried setting it sticky, using alarm, and broadcast receiver on destroy. But neither of them worked out. When I kill the application it never wake up again. But on the same device Whatsapp works perfectly, and even if I kill it, it wake up again..
有没有不用GCM的方法吗?
Is there any way to do it without use GCM?
我已经查找了一些链接:
Some of the link I already looked up:
如何自动重启被终止的服务?
重复运行方法,经过一段时间
stackoverflow/a/21551045/627307
推荐答案我不确定它是否能为您解决问题,但对我有用.
I'm not sure if it will solve the issue for you or not but it worked for me.
我正在运行MIUI 6.6.10
I'm running MIUI 6.6.10
打开小米提供的安全应用
单击权限->自动启动
此处允许您的应用自动启动
Here allow your app to auto start
WhatsApp和所有著名应用程序都可以工作,因为小米白列出了它们并允许它们自动启动.
WhatsApp and all famous apps work because Xiaomi white listed them and allowed them to autostart.
更多推荐
被杀死后如何自动重启服务?
发布评论