I already using startforeground()
at my Service
, but Android keeps killing my Service
when I clear all the recent apps.
Here\'
you can use START_REDELIVER_INTENT instead of START_STICKY
The simplest explanation of these could be,
START_STICKY- tells the system to create a fresh copy of the service, when sufficient memory is available, after it recovers from low memory. Here you will lose the results that might have computed before.
START_NOT_STICKY- tells the system not to bother to restart the service, even when it has sufficient memory.
START_REDELIVER_INTENT- tells the system to restart the service after the crash and also redeliver the intents that were present at the time of crash.
I hope this will help you. thanks