code: void addNetworkReachabilityListener(NetworkReachabilityListener listener) {
          synchronized (listeners) {
              listeners.add(listener);
              if (listeners.size() == 1) { startListening(); }
          }
      }
docs: Add Network Reachability Listener