How to restart service in android to call service oncreate again

前端 未结 6 1499
慢半拍i
慢半拍i 2020-12-09 08:10

I have a service in my Android Application which runs always.Now i have a settings from my server through GCM and update these settings to my service. I put my settings in o

6条回答
  •  有刺的猬
    2020-12-09 08:33

    Why not move the setting stuff from onCreate to a separate method. You can then call this method from onCreate and also call it when you need to change the settings. Then there would be no need to actually restart the service.

提交回复
热议问题