Takes care of the grunt work of maintaining a list of remote interfaces,
typically for the use of performing callbacks from a
Android.App.Service to its clients.
See Also:
RemoteCallbackList Members
Syntax
[Android.Runtime.Register("android/os/RemoteCallbackList", DoNotGenerateAcw=true)]
public class
RemoteCallbackList :
Java.Lang.ObjectRemarks
Takes care of the grunt work of maintaining a list of remote interfaces,
typically for the use of performing callbacks from a
Android.App.Service to its clients. In particular, this:
- Keeps track of a set of registered Android.OS.IInterface callbacks,
taking care to identify them through their underlying unique Android.OS.BinderConsts
(by calling IInterface.AsBinder.
- Attaches a Android.OS.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(int), 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.
[Android Documentation]
Requirements
Namespace: Android.OS
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1