android Service的个人理解

1.个人对onBind(Intent intent)的理解 

     多个client可以同时连接到同一个service,但是只有第一次连接的时候会调用onBind(),其他的client调用BindService时,不再调用onBind(),只会返回IBinder,onServiceConnected仍然会被多次调用。当所有的client unbind,service 将会被destroyed。

 

Multiple clients can connect to the service at once. However, the system calls your service's onBind() method to retrieve the IBinder only when the first client binds. The system then delivers the same IBinder to any additional clients that bind, without calling onBind() again.http://developer.android.com/guide/components/bound-services.html Multiple components can bind to the service at once, but when all of them unbind, the service is destroyed.

参考:http://stackoverflow.com/questions/3069409/illegalargumentexception-service-not-registered

posted @ 2013-10-31 17:40  自由飞翔2012  阅读(159)  评论(0编辑  收藏  举报