标签 beginBroadcast 下的文章

AIDL 回调中的 IllegalStateException

beginBroadcast java.lang.IllegalStateException 已知在 aidl 中回调注册的 callback 对象时, 需要使用 beginBroadcast() 和 finishBroadcast(), 且一个 begin 之后对应一个 finish; 下面是官方建议的回调的写法; int i = callbacks.beginBroadcast(); while (i > 0) { i--; try { callbacks.getBroadcastItem(i).somethingHappened(); } catch (RemoteException e) { // The RemoteCallbackList will take c ...