RemoteCallbackList.Unregister(Object) Method

Definition

Remove from the list a callback 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")>]
abstract member Unregister : Java.Lang.Object -> bool
override this.Unregister : Java.Lang.Object -> bool

Parameters

callback
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 callback was found and unregistered. Returns false if the given callback was not found on the list.

Attributes

Remarks

Remove from the list a callback that was previously added with #register. This uses the IInterface#asBinder callback.asBinder() object to correctly find the previous registration. Registrations are not counted; a single unregister call will remove a callback 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