Binding and starting a service when application starts

主宰稳场 提交于 2019-12-07 23:57:30

In my opinion, you did a good job when you decided to run service in Application onCreate. but it is strange to hear that service is started when you close the app. I have done this several times, and service starts in application onCreate which must be called.

Have you checked if your application is alive and run in background? Please make sure that you killed you application before testing. Use Task Killer or something like that, to be sure that application is always freshly started.

Sadly, Android does not have appropriate mechanism to notify you when application is exited, because it is still alive until system decides to kill it and free resources.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!