語言

DeviceAdminService.OnBind(Intent) 方法

定義

把通訊頻道還給服務單位。

[Android.Runtime.Register("onBind", "(Landroid/content/Intent;)Landroid/os/IBinder;", "", ApiSince=26)]
public override sealed Android.OS.IBinder? OnBind(Android.Content.Intent? intent);
[<Android.Runtime.Register("onBind", "(Landroid/content/Intent;)Landroid/os/IBinder;", "", ApiSince=26)>]
override this.OnBind : Android.Content.Intent -> Android.OS.IBinder

參數

intent
Intent

用於綁定此服務的意圖,依據 Context.bindService 所提供的。 請注意,當時隨意圖附帶的任何額外內容在這裡都不會看到。

傳回

回傳一個 IBinder,讓客戶端可以呼叫該服務。

屬性

備註

把通訊頻道還給服務單位。 回傳的 IBinder 通常是針對已使用 aidl 描述的複雜介面。

請注意,與其他應用程式元件不同,這裡回傳的 IBinder 介面呼叫可能不會發生在程序的主執行緒上。 關於主線程的更多資訊可參考「程序與執行緒」。

Android 參考資料。android.app.admin.DeviceAdminService.onBind

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於