network receiver is not working
<p>I try to implement the network receiver, here is my following code:</p>

<pre><code>   package com.example.androidtablayout;

 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
 import android.net.ConnectivityManager;
 import android.net.NetworkInfo;
 import android.util.Log;

public class NetworkReceiver extends BroadcastReceiver { // &lt;1&gt;
 public static final String TAG = "NetworkReceiver";
 boolean isConnected = true;
Context c;
 @Override
 public void onReceive(Context context, Intent intent) {


  boolean isNetworkDown = intent.getBooleanExtra(
    ConnectivityManager.EXTRA_NO_CONNECTIVITY, false);  // &lt;2&gt;

  if (isNetworkDown) {
    Log.d(TAG, "onReceive: NOT connected, stopping UpdaterService");
   // context.stopService(new Intent(context, UpdaterService.class)); // &lt;3&gt;
   } else {
       Log.d(TAG, "onReceive: connected, starting UpdaterService");
   //  context.startService(new Intent(context, UpdaterService.class)); // &lt;4&gt;
    }
  }

 }
</code></pre>

<p>In the Manifest.xml</p>

<pre><code>      &lt;application&gt;
       &lt;receiver android:name=".NetworkReceiver"&gt;
    &lt;intent-filter&gt;
      &lt;action android:name="android.net.conn.CONNECTIVITY_CHANGE" /&gt;
    &lt;/intent-filter&gt;
      &lt;/receiver&gt; 
   &lt;/application&gt;

  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
</code></pre>

<p>My problem is when I switch off the wifi, the log still shows that "Connected",</p>

<p>I think the the network receiver didn't receiver the intenet connectivity correctly.Any help will be greatly appreciated.</p>
