public void notifyChatSessionCreateFailed(final String name, final ImErrorInfo error) { final int N = mRemoteListeners.beginBroadcast(); for (int i = 0; i < N; i++) { IChatSessionListener listener = mRemoteListeners.getBroadcastItem(i); try { listener.onChatSessionCreateError(name, error); } catch (RemoteException e) { // The RemoteCallbackList will take care of removing the // dead listeners. } } mRemoteListeners.finishBroadcast(); }
public void onChatSessionCreated(ChatSession session) { final IChatSession sessionAdapter = getChatSessionAdapter(session); final int N = mRemoteListeners.beginBroadcast(); for (int i = 0; i < N; i++) { IChatSessionListener listener = mRemoteListeners.getBroadcastItem(i); try { listener.onChatSessionCreated(sessionAdapter); } catch (RemoteException e) { // The RemoteCallbackList will take care of removing the // dead listeners. } } mRemoteListeners.finishBroadcast(); }