ContextWrapper.BindService(Intent, IServiceConnection, Bind) Method

Definition

Connect to an application service, creating it if needed.

[Android.Runtime.Register("bindService", "(Landroid/content/Intent;Landroid/content/ServiceConnection;I)Z", "GetBindService_Landroid_content_Intent_Landroid_content_ServiceConnection_IHandler")]
public override bool BindService(Android.Content.Intent? service, Android.Content.IServiceConnection? conn, Android.Content.Bind flags);
[<Android.Runtime.Register("bindService", "(Landroid/content/Intent;Landroid/content/ServiceConnection;I)Z", "GetBindService_Landroid_content_Intent_Landroid_content_ServiceConnection_IHandler")>]
override this.BindService : Android.Content.Intent * Android.Content.IServiceConnection * Android.Content.Bind -> bool

Parameters

service
Intent

Identifies the service to connect to. The Intent may specify either an explicit component name, or a logical description (action, category, etc) to match an IntentFilter published by a service.

conn
IServiceConnection

Receives information as the service is started and stopped. This must be a valid ServiceConnection object; it must not be null.

Returns

true if the system is in the process of bringing up a service that your client has permission to bind to; false if the system couldn't find the service or if your client doesn't have permission to bind to it. Regardless of the return value, you should later call unbindService(ServiceConnection) to release the connection.

Attributes

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Java documentation for android.content.ContextWrapper.bindService(android.content.Intent, android.content.ServiceConnection, int).

Applies to