次の方法で共有


RemoteCallbackList.Register Method

Definition

Overloads

Register(Object)

Simple version of RemoteCallbackList#register(E, Object) that does not take a cookie object.

Register(Object, Object)

Add a new callback to the list.

Register(Object)

Simple version of RemoteCallbackList#register(E, Object) that does not take a cookie object.

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

Parameters

callback
Object

Returns

Attributes

Remarks

Simple version of RemoteCallbackList#register(E, Object) that does not take a cookie object.

Java documentation for android.os.RemoteCallbackList.register(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

Register(Object, Object)

Add a new callback to the list.

[Android.Runtime.Register("register", "(Landroid/os/IInterface;Ljava/lang/Object;)Z", "GetRegister_Landroid_os_IInterface_Ljava_lang_Object_Handler")]
public virtual bool Register (Java.Lang.Object? callback, Java.Lang.Object? cookie);
[<Android.Runtime.Register("register", "(Landroid/os/IInterface;Ljava/lang/Object;)Z", "GetRegister_Landroid_os_IInterface_Ljava_lang_Object_Handler")>]
abstract member Register : Java.Lang.Object * Java.Lang.Object -> bool
override this.Register : Java.Lang.Object * Java.Lang.Object -> bool

Parameters

callback
Object

The callback interface to be added to the list. Must not be null -- passing null here will cause a NullPointerException. Most services will want to check for null before calling this with an object given from a client, so that clients can't crash the service with bad data.

cookie
Object

Optional additional data to be associated with this callback.

Returns

Returns true if the callback was successfully added to the list. Returns false if it was not added, either because #kill had previously been called or the callback's process has gone away.

Attributes

Remarks

Add a new callback to the list. This callback will remain in the list until a corresponding call to #unregister or its hosting process goes away. If the callback was already registered (determined by checking to see if the IInterface#asBinder callback.asBinder() object is already in the list), then it will be left as-is. Registrations are not counted; a single call to #unregister will remove a callback after any number calls to register it.

Java documentation for android.os.RemoteCallbackList.register(E, java.lang.Object).

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