开发者

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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜