RemoteCallbackList.Register Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Register(Object) |
Simple version of |
| Register(Object, Object) |
Add a new interface 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")]
public virtual bool Register(Java.Lang.Object? callbackInterface);
[<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
- callbackcallbackInterface
- 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 interface 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")]
public virtual bool Register(Java.Lang.Object? callbackInterface, 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
- callbackcallbackInterface
- 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 interface.
Returns
Returns true if the interface was successfully added to the list.
Returns false if it was not added, either because #kill had
previously been called or the interface's process has gone away.
- Attributes
Remarks
Add a new interface to the list. This interface will remain in the list until a corresponding call to #unregister or its hosting process goes away. If the interface was already registered (determined by checking to see if the IInterface#asBinder callbackInterface.asBinder() object is already in the list), then it will be replaced with the new interface. Registrations are not counted; a single call to #unregister will remove an interface 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.