My application has a service for checking and downloading data from server. I have exited the application after starting service. Now the application and service are in the memory. I have force stopped the application (not service) from memory. Then my service is also stopped. How can I prevent stopping my service. If application is stopped by the OS, my service will be there or not?
My application has a service for checking and downloading data from server. I have
Share
If service and UI are sharing same process then FC in either part will cause both to be killed. However, your first approach should be to avoid getting FC errors. Track down to the reasons for this issue and if possible encapsulate critical parts of your code with in
try/catchblocks.Moreover, you should return
Service.START_STICKYin onStartCommand of your service to re-create it in case its killed.