ContextWrapper.BindService(Intent, IServiceConnection, Bind) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
連接應用程式服務,必要時建立它。
[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 物件;它不能是無效的。
- flags
- Bind
綁定的操作選項。 可能是0、 Android.Content.Context.BIND_AUTO_CREATE、 Android.Content.Context.BIND_DEBUG_UNBIND、 Android.Content.Context.BIND_NOT_FOREGROUND、 Android.Content.Context.BIND_ABOVE_CLIENT、 Android.Content.Context.BIND_ALLOW_OOM_MANAGEMENT,或者 Android.Content.Context.BIND_WAIVE_PRIORITY。
傳回
- 屬性
備註
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。