public void startMonitoringNetworkChanges() {
        if (networkReceiver != null) {
            IntentFilter filter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
            context.registerReceiver(networkReceiver, filter);
        } else {
            logger.warn("Cannot monitor device network changes. Make sure that a NetworkConnectionListener was passed to the NetworkMonitor constructor.");
        }
    }
public void startMonitoringNetworkChanges ( ) { if ( networkReceiver != null ) { IntentFilter filter = new IntentFilter ( ConnectivityManager . CONNECTIVITY_ACTION ) ; context . registerReceiver ( networkReceiver , filter ) ; } else { logger . warn ( "Cannot monitor device network changes. Make sure that a NetworkConnectionListener was passed to the NetworkMonitor constructor." ) ; } }
Begin monitoring changes in the device's network connection.
Before using this method, be sure to pass a {@link NetworkConnectionListener} to
{@link #NetworkMonitor(Context, NetworkConnectionListener)}.