Share via


RemoteCallbackList.GetRegisteredCallbackCookie(Int32) Method

Definition

Return any cookie associated with a currently registered callback.

[Android.Runtime.Register("getRegisteredCallbackCookie", "(I)Ljava/lang/Object;", "GetGetRegisteredCallbackCookie_IHandler", ApiSince=26)]
public virtual Java.Lang.Object? GetRegisteredCallbackCookie (int index);
[<Android.Runtime.Register("getRegisteredCallbackCookie", "(I)Ljava/lang/Object;", "GetGetRegisteredCallbackCookie_IHandler", ApiSince=26)>]
abstract member GetRegisteredCallbackCookie : int -> Java.Lang.Object
override this.GetRegisteredCallbackCookie : int -> Java.Lang.Object

Parameters

index
Int32

Index of which registration cookie to return, from 0 to #getRegisteredCallbackCount() - 1.

Returns

Returns whatever cookie object is associated with this index, or null if #kill() has been called.

Attributes

Remarks

Return any cookie associated with a currently registered callback. Note that this is <em>not</em> the same as #getBroadcastCookie and should not be used interchangeably with it. This method returns the current cookie registered at the given index, not the current broadcast state. This means that it is not itself thread-safe: any call to #register or #unregister will change these indices, so you must do your own thread safety between these to protect from such changes.

Java documentation for android.os.RemoteCallbackList.getRegisteredCallbackCookie(int).

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