語言

IServiceConnection.OnNullBinding(ComponentName) 方法

定義

當被綁定的服務從其null方法返回android.app.Service#onBind(Intent) onBind()時,會被呼叫。

[Android.Runtime.Register("onNullBinding", "(Landroid/content/ComponentName;)V", "GetOnNullBinding_Landroid_content_ComponentName_Handler:Android.Content.IServiceConnection, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=28)]
public virtual void OnNullBinding(Android.Content.ComponentName? name);
[<Android.Runtime.Register("onNullBinding", "(Landroid/content/ComponentName;)V", "GetOnNullBinding_Landroid_content_ComponentName_Handler:Android.Content.IServiceConnection, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=28)>]
abstract member OnNullBinding : Android.Content.ComponentName -> unit
override this.OnNullBinding : Android.Content.ComponentName -> unit

參數

name
ComponentName

服務實作拒絕其綁定的具體元件名稱。

屬性

備註

當被綁定的服務從其null方法返回android.app.Service#onBind(Intent) onBind()時,會被呼叫。 這表示此服務連接所代表的嘗試服務綁定永遠無法使用。

<b>注意:</b> 請求綁定的應用程式仍必須呼叫 Context#unbindService(ServiceConnection) 以釋放與此 ServiceConnection 相關的追蹤資源,即使此回調是在 Context#bindService Context.bindService() bindService()後被呼叫的。

Java 文件 android.content.ServiceConnection.onNullBinding(android.content.ComponentName)。

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

適用於