Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android IntentService Queue

Tags:

android

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 IntentServicenow 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

like image 543
user1730789 Avatar asked May 28 '26 01:05

user1730789


1 Answers

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.

like image 68
CommonsWare Avatar answered May 30 '26 14:05

CommonsWare



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!