Android Guides | Samples

Android.App.Service.OnBind Method

Return the communication channel to the service.

Syntax

[Android.Runtime.Register("onBind", "(Landroid/content/Intent;)Landroid/os/IBinder;", "GetOnBind_Landroid_content_Intent_Handler")]
public abstract IBinder OnBind (Intent intent)

Parameters

intent
The Intent that was used to bind to this service, as given to Context.BindService(Intent,IServiceConnection,IServiceConnection). Note that any extras that were included with the Intent at that point will not be seen here.

Remarks

Return the communication channel to the service. May return null if clients can not bind to the service. The returned BinderConsts is usually for a complex interface that has been described using aidl.

Note that unlike other application components, calls on to the IBinder interface returned here may not happen on the main thread of the process. More information about the main thread can be found in Processes and Threads.

[Android Documentation]

Requirements

Namespace: Android.App
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1