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)

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..

Is there any way to do it without use GCM?

Some of the link I already looked up:

How to restart a killed service automatically?

Service that repeatedly runs a method, after an amount of time

https://stackoverflow.com/a/21551045/627307

Community
  • 1
  • 1
M4rk
  • 2,172
  • 5
  • 36
  • 70

1 Answers1

4

I'm not sure if it will solve the issue for you or not but it worked for me.

I'm running MIUI 6.6.10

  1. Open the Security app provided by Xiaomi

  2. Click on permissions -> Autostart

  3. Here allow your app to auto start

WhatsApp and all famous apps work because Xiaomi white listed them and allowed them to autostart.

Jaydeep Solanki
  • 2,895
  • 5
  • 36
  • 50
  • did you check whether it's restarting the service or not ? if yes, how did you check ? because I have enabled the Autostart option for my app, still don't know how find whether it is restarted on killing it or not. – Kamalakannan J Aug 24 '16 at 11:41