English | Site Directory

Android - An Open Handset Alliance Project

android.content
public interface

android.content.ServiceConnection

android.content.ServiceConnection

Interface for monitoring the state of an application service. See Service and Context.bindService() for more information.

Summary

Public Methods

        void  onServiceConnected(ComponentName name, IBinder service)
Called when a connection to the Service has been established, with the IBinder of the communication channel to the Service.
        void  onServiceDisconnected(ComponentName name)
Called when a connection to the Service has been lost.

Details

Public Methods

public void onServiceConnected(ComponentName name, IBinder service)

Called when a connection to the Service has been established, with the IBinder of the communication channel to the Service.

Parameters

name The concrete component name of the service that has been connected.
service The IBinder of the Service's communication channel, which you can now make calls on.

public void onServiceDisconnected(ComponentName name)

Called when a connection to the Service has been lost. This typically happens when the process hosting the service has crashed or been killed. This does not remove the ServiceConnection itself -- this binding to the service will remain active, and you will receive a call to onServiceConnected(ComponentName, IBinder) when the Service is next running.

Parameters

name The concrete component name of the service whose connection has been lost.
Build m5-rc15g - 14 May 2008 12:50