Android Service and thread
Is a "Service" in android same as a separate th开发者_如何学编程read ?
From Service javadoc:
Note that services, like other application objects, run in the main thread of their hosting process.
So the answer is No.
A Service is not a separate process. The Service object itself does not imply it is running in its own process; unless otherwise specified, it runs in the same process as the application it is part of. A Service is not a thread. It is not a means itself to do work off of the main thread (to avoid Application Not Responding errors).
精彩评论