Share via


RemoteCallbackList.Unregister(Object) Method

Definition

Remove from the list an interface that was previously added with #register.

[Android.Runtime.Register("unregister", "(Landroid/os/IInterface;)Z", "GetUnregister_Landroid_os_IInterface_Handler")]
public virtual bool Unregister(Java.Lang.Object? callback);
[Android.Runtime.Register("unregister", "(Landroid/os/IInterface;)Z", "GetUnregister_Landroid_os_IInterface_Handler")]
public virtual bool Unregister(Java.Lang.Object? callbackInterface);
[<Android.Runtime.Register("unregister", "(Landroid/os/IInterface;)Z", "GetUnregister_Landroid_os_IInterface_Handler")>]
abstract member Unregister : Java.Lang.Object -> bool
override this.Unregister : Java.Lang.Object -> bool

Parameters

callbackcallbackInterface
Object

The callback to be removed from the list. Passing null here will cause a NullPointerException, so you will generally want to check for null before calling.

Returns

Returns true if the interface was found and unregistered. Returns false if the given interface was not found on the list.

Attributes

Remarks

Remove from the list an interface that was previously added with #register. This uses the IInterface#asBinder callbackInterface.asBinder() object to correctly find the previous registration. Registrations are not counted; a single unregister call will remove an interface after any number calls to #register for it.

Java documentation for android.os.RemoteCallbackList.unregister(E).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to