Freigeben über


RemoteCallbackList.GetRegisteredCallbackItem(Int32) Method

Definition

Return a currently registered callback.

[Android.Runtime.Register("getRegisteredCallbackItem", "(I)Landroid/os/IInterface;", "GetGetRegisteredCallbackItem_IHandler", ApiSince=26)]
public virtual Java.Lang.Object? GetRegisteredCallbackItem (int index);
[<Android.Runtime.Register("getRegisteredCallbackItem", "(I)Landroid/os/IInterface;", "GetGetRegisteredCallbackItem_IHandler", ApiSince=26)>]
abstract member GetRegisteredCallbackItem : int -> Java.Lang.Object
override this.GetRegisteredCallbackItem : int -> Java.Lang.Object

Parameters

index
Int32

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

Returns

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

Attributes

Remarks

Return a currently registered callback. Note that this is <em>not</em> the same as #getBroadcastItem and should not be used interchangeably with it. This method returns the registered callback 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.getRegisteredCallbackItem(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