title: How to trigger BroadcastReceiver when I turn on/off Mobile Cellular Data(Mobile Internet)
body: <p>I want to know how to trigger <strong>BroadcastReceiver</strong> if I <strong>turn on/off mobile cellular data</strong>. I already registered BroadcastReceiver and <strong>it is working fine if I turn on/off wifi but if I turn on/off cellular data no broadcast trigger. can anyone please help me about this?</strong></p>
  
  <p><strong>Here is my code.</strong></p>
  
  <p>Here I register <strong>BroadcastReceiver</strong> in <strong>Manifest.file</strong> </p>
  
  <pre><code>       &lt;receiver android:name="com.servicesandroid.NetworkCheckReceiver" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.net.conn.CONNECTIVITY_CHANGE" /&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
  </code></pre>
  
  <p><strong>Manifest permissions</strong></p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
      &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  </code></pre>
  
  <p>Here is my <strong>BroadcastReceiver class.</strong></p>
  
  <pre><code>public class NetworkCheckReceiver extends BroadcastReceiver {
  
      @Override
      public void onReceive(Context context, Intent intent) {
          // TODO Auto-generated method stub
          Toast.makeText(context, "Started", Toast.LENGTH_SHORT).show();
           Log.d("app","Network connectivity change");
      }
  
  }
  </code></pre>