开发者

Android Service and thread

开发者 https://www.devze.com 2023-02-10 20:20 出处:网络
Is a \"Service\" in android same as a separate th开发者_如何学编程read ?From Service javadoc:

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

精彩评论

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