Android Service: onBind(Intent) and onUnbind(Intent) is called just once

前端 未结 2 1137
慢半拍i
慢半拍i 2020-12-24 05:38

I have the Activity and the Service. When Activity is started, it calls startService() to make this Service be alive even when Activity is destroyed, and

2条回答
  •  爱一瞬间的悲伤
    2020-12-24 06:07

    I think this (referenced from official dev guide) can explain all your queries:

    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.

提交回复
热议问题