gpt4 book ai didi

android - RemoteCallbackList 与 arrayList

转载 作者:行者123 更新时间:2023-11-30 02:06:37 25 4
gpt4 key购买 nike

When we use aidl ,we often use  code like this:

RemoteCallbackList<IRemoteServiceCallback> mCallbacks .

我们可以使用ArrayList<IRemoteServiceCallback> mCallbacks吗? ?

最佳答案

它是一个与 ArrayList 相同的 List 所以YES 但你不想像 RemoteCallbackList为你做额外的事情 1

Keeps track of a set of registered IInterface callbacks

还有

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 onCallbackDied(E) method.

文档中的所有引用

关于android - RemoteCallbackList 与 arrayList,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30586124/

25 4 0