My service is restarted each time the application is closed

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 07:47:08

问题


I have a service in my app and start it as follows

Intent intent = new Intent(this, Prueba.class);
startService(intent);

Also, your method return onStartCommand STAR_STICKY;

However, every time I close the app the service is restarted. As for the service do not restarts and keep running?


回答1:


Please check it out may be this can be useful for you:

http://developer.android.com/reference/android/app/Service.html#ServiceLifecycle



来源:https://stackoverflow.com/questions/20804228/my-service-is-restarted-each-time-the-application-is-closed

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