1

I have two intentservices: IntentServiceA and IntentServiceB.

While IntentServiceA is running and if I call startService(IntentServiceB) , will IntentServiceB run concurrently with IntentServiceA or does it wait till IntentServiceA stops?

If it was about Asynctasks it would be: AsyncktaskB won't start till AsynctaskA is finished. But I could not find any documentation for this scenario in case of IntentService.

Hugo Sousa
  • 1,904
  • 2
  • 15
  • 28
achavan804
  • 13
  • 3

1 Answers1

0

A quick look at the IntentService source code indicates that each IntentService should have its own HandlerThread and therefore should run concurrently. That being said, I do not recall ever trying this.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • `@CommonsWare`: I have two Asynctasks viz. AsynctaskA and AsynctaskB. AsynctaskA have high priority than AsynctaskB. So I don't want AsynctaskA to wait till AsynctaskB finishes. Hence I made IntentServiceB to perform same work that AsynctaskB was doing. But here I had doubt (hence problem) about two IntentServices running concurrently as I have IntentServiceA which runs when app receives GCM and have high priority than IntentServiceB and I don't wan't IntentServiceA to wait till IntentServiceB finishes. Hence asked. Thanks for such a quick answer. – achavan804 Mar 30 '14 at 21:20
  • @achavan804: "So I don't want AsynctaskA to wait till AsynctaskB finishes" -- it won't, if you are using `executeOnExecutor()`. – CommonsWare Mar 31 '14 at 06:21