ContextWrapper.BindService(Intent, IServiceConnection, Bind) 方法

定義

連接應用程式服務,必要時建立它。

[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

參數

service
Intent

識別要連接的服務。 意圖可以指定明確的元件名稱,或邏輯描述(動作、類別等),以匹配服務發佈的 IntentFilter 名稱。

conn
IServiceConnection

服務開始與停止時會接收資訊。 此物件必須是有效的 ServiceConnection 物件;它不能是無效的。

傳回

屬性

備註

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

適用於