共用方式為


Service.OnBind(Intent) 方法

定義

將通道傳回至服務。

[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

參數

intent
Intent

用來繫結至此服務的意圖,如 提供給 android.content.Context#bindService Context.bindService。 請注意,在該時間點隨附於意圖的任何額外項目,都會 <在此看到 em>not</em> 。

傳回

傳回 IBinder,用戶端可以透過此 IBinder 呼叫服務。

屬性

備註

將通道傳回至服務。 如果客戶端無法繫結至服務,可能會傳回 null。 傳回android.os.IBinder的 通常是針對使用 aidl 描述的複雜介面

<em>請注意,與其他應用程式元件不同,呼叫此處傳回的IBinder 介面可能不會發生在進程</em>的主線程上。 如需主要線程的詳細資訊,請參閱 進程和線程

android.app.Service.onBind(android.content.Intent)Java 檔。

此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。

適用於