Binder onBind Intent intent boolean onUnbind Intent intent void onRebind Intent intent

The onBind( ) callback is passed the Intent object that was passed to bindService and onUnbind() is handed the intent that was passed to unbindService() . If the service permits the binding, onBind( ) returns the communications channel that clients use to interact with the service. The onUnbind() method can ask for onRebind() to be called if a new client connects to the service.

The following diagram illustrates the callback methods for a service. Although, it separates services that are created via startService from those created by bindService() , keep in mind that any service, no matter how it's started, can potentially allow clients to bind to it, so any service may receive onBind() and onUnbind() calls.

0 0

Post a comment