i want to start service in android if its being killed manually by a user ,i have read a lot about this and here what i am using in my service
my service is fetching a current user location on a regular interval and its a START_STICKY service. as i have read that whatsapp
is using GCM
to turn on the service again if its being manually killed by the user , so i have implemented GCM
too and enable the service.
but if i manually killed my service then GCM
also gets stopped ( which is an obvious reason) , so i think its a MYTH that whatsapp
is using GCM
to restart their own service , there is no magic behind whtsapp
.
i have tried restarting the service by calling startService
from onDestroy
but that doesnt work too.
i have tried to run service as a separate process too by using process attribute but it doesnt effect
so is there still any way to immediately restart the service if its being killed by the user itself
note: i already know that if service is being killed by the user manually , OS will restart it soon automatically if the service is START_STICKY