Service.OnBind(Intent) Method

Definition

Return the communication channel to the service.

[Android.Runtime.Register("onBind", "(Landroid/content/Intent;)Landroid/os/IBinder;", "GetOnBind_Landroid_content_Intent_Handler")]
public abstract Android.OS.IBinder? OnBind (Android.Content.Intent? intent);
[<Android.Runtime.Register("onBind", "(Landroid/content/Intent;)Landroid/os/IBinder;", "GetOnBind_Landroid_content_Intent_Handler")>]
abstract member OnBind : Android.Content.Intent -> Android.OS.IBinder

Parameters

intent
Intent

The Intent that was used to bind to this service, as given to android.content.Context#bindService Context.bindService. Note that any extras that were included with the Intent at that point will <em>not</em> be seen here.

Returns

Return an IBinder through which clients can call on to the service.

Attributes

Remarks

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

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

Java documentation for android.app.Service.onBind(android.content.Intent).

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.

Applies to