See Also: RemoteCallbackList
public class RemoteCallbackList : Object
Takes care of the grunt work of maintaining a list of remote interfaces, typically for the use of performing callbacks from a Service to its clients. In particular, this:
- Keeps track of a set of registered IInterface callbacks, taking care to identify them through their underlying unique BinderConsts (by calling IInterface.AsBinder.
- Attaches a IBinderDeathRecipient to each registered interface, so that it can be cleaned out of the list if its process goes away.
- Performs locking of the underlying list of interfaces to deal with multithreaded incoming calls, and a thread-safe way to iterate over a snapshot of the list without holding its lock.
To use this class, simply create a single instance along with your service, and call its RemoteCallbackList.register(E) and RemoteCallbackList.unregister(E) methods as client register and unregister with your service. To call back on to the registered clients, use RemoteCallbackList.BeginBroadcast, RemoteCallbackList.GetBroadcastItem(Int32), and RemoteCallbackList.FinishBroadcast.
If a registered callback's process goes away, this class will take care of automatically removing it from the list. If you want to do additional work in this situation, you can create a subclass that implements the RemoteCallbackList.onCallbackDied(E) method.
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1
The members of Android.OS.RemoteCallbackList are listed below.
See Also: Object
Prepare to start making calls to the currently registered callbacks.
Clean up the state of a broadcast previously initiated by calling RemoteCallbackList.BeginBroadcast.
Retrieve the cookie associated with the item returned by RemoteCallbackList.GetBroadcastItem(Int32).
Retrieve an item in the active broadcast that was previously started with RemoteCallbackList.BeginBroadcast.
Disable this callback list.