title: How to notify when wifi is switched on (/off) by a foreground app?
body: <p>I'm trying to run an app in background which tells me when the status of wifi is modified;</p>
  
  <pre><code>public class BackgroundJobs extends Service {
  
  public int onStartCommand(Intent intent, int flags, int startId) {
      Log.i("BACKJOBS", "here we are");
      wifiInfo wifiHandler = new wifiInfo(this);
      // wifistatus checks if wifi is on or off, returning a boolean
      if(wifiHandler.wifiStatus())
          Log.i("BACKJOBS", "WIFI ON");
      else
          Log.i("BACKJOBS", "WIFI OFF");
      return Service.START_NOT_STICKY;
  }
  
  @Override
  public IBinder onBind(Intent intent) {
      //TODO for communication return IBinder implementation
      return null;
  }
  }
  </code></pre>
  
  <p>In my MainActivity I start the service as follows:</p>
  
  <pre><code>startService(new Intent(this, BackgroundJobs.class));
  </code></pre>
  
  <p>and in AndroidManifest.xml:</p>
  
  <pre><code>&lt;service android:name=".gestioneServizi.BackgroundJobs"/&gt;
  </code></pre>
  
  <p>I start my app, I go back to my home pushing the home button, i switch on or off the wifi, but I don't see the logs "BACKJOBS".</p>
  
  <p>Am i misunderstanding something or I'm working with the wrong method?</p>