当前位置:网站首页>Two state forms of Service

Two state forms of Service

2022-08-11 07:51:00 is a small A

Started status (started)

A service is "started" when an application component (such as an Activity) starts the service by calling startService().Once started, the service can run in the background indefinitely, even if the component that started the service has been destroyed, the service can not be stopped unless it is manually called, the service that has been started usually performs a single operation and does not return the result to the callerParty


Bound state (bound)

Features: The caller is bound to the service. Once the caller quits, the service will be terminated.

A service is "bound" when an application component binds to it by calling bindService().A bound service provides a client-server interface that allows components to interact with the service, send requests, get results, and even perform these operations across processes using inter-process communication (IPC).A bound service will only run when bound to another application component.Multiple components can be bound to the service at the same time, but the service will be destroyed when they are all unbound

原网站

版权声明
本文为[is a small A]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/223/202208110644322391.html