Android: Passing variables to an already running service
If your service is not an IntentService
, you can call startService(...)
as many times you want. The service will run the first time but next calls will result in new onStartCommand()
calls with the new extras you need.
Check this answer and the doc.