Reputation: 5177
Suppose i have two classes that inherit from IntentService. Now quoting from the documentation
All requests are handled on a single worker thread -- they may take as long as necessary (and will not block the application's main loop), but only one request will be processed at a time.
Now suppose my classes are called SericeA extends IntentService
, and ServiceB extends IntentService
now when i call startService for an object of type ServiceA and startService for an Object of type ServiceB, will these both be handled by the same worker thread. Is there a System wide worker thread, or just a worker thread associated with a particular IntentService.
Kind Reagrds
Upvotes: 3
Views: 485
Reputation: 1007658
will these both be handled by the same worker thread
No.
or just a worker thread associated with a particular IntentService.
Yes.
You can tell this by looking at the source code to IntentService
and noticing that each IntentService
creates its own HandlerThread
.
Upvotes: 4