@Override
  public void onReceive(Context context, Intent intent) {
    if (intent.getAction().equals(TimeTrackingService.BROADCAST_USER_UPDATE)) {

      UserDTO user = new UserDTO();
      user.loadFromJSON(intent.getStringExtra(TimeTrackingService.BROADCAST_USER_JSON));

      if (mListener != null && user.getId() != null && mListener.isListenToUser(user.getId())) {
        mListener.onUpdateUser(user);
      }
    }
  }
示例#2
0
 public synchronized void notifyListeners(byte[] buf) {
   for (ReceiverListener listener : listeners) {
     listener.onBytesReceived(buf);
   }
 }