Basically I have a service, which runs in main process of the app. My requirement is that my service should always run. Even if the app crashes,it should restart unless user manually stops it. So I'm using sticky service which creates the service again if it stops improperly.
But today I've noticed a strange problem. My app was down, and when I checked in settings, I saw on running, it says 0 process and 1 service running. Which baffled me, my service runs in main process, if the process is 0, then how come the service is running? The process owns the service, so how can a service run when its parent process is dead?
And how to make sure that my process always gets restarted if it ever gets stopped?