title: BroadcastReceiver declared in manifest is not receiving the Broadcast
body: <p>I've tried to register a Wifi BroadcastReceiver to get the wifi state when it changes. But so far I have no luck receiving the broadcast.</p>
  
  <pre><code>&lt;application
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name" &gt;
      &lt;receiver android:name=".WifiReceiver" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.net.wifi.WifiManager.WIFI_STATE_CHANGED_ACTION" /&gt;
              &lt;action android:name="android.intent.action.PHONE_STATE" /&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  
      //activity declaration here...
  
  &lt;/application&gt;
  </code></pre>
  
  <p>Do you guys know how to register the BraodcastReceiver in manifest?</p>
  
  <p><strong>I don't want to register it in activities</strong> because I want to <strong>monitor the wifi</strong> when there is changes in the wifi state whether my application is running or not.</p>
  
  <p>This is my BroadcastReceiver class:</p>
  
  <pre><code>public class WifiReceiver extends BroadcastReceiver {
      private final String TAG = "WifiReceiver";
  
      @Override
      public void onReceive(Context context, Intent intent) {
          int wifiState = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE, WifiManager.WIFI_STATE_UNKNOWN);
          String wifiStateText = "No State";
  
          switch (wifiState) {
          case WifiManager.WIFI_STATE_DISABLING:
              wifiStateText = "WIFI_STATE_DISABLING";
              break;
          case WifiManager.WIFI_STATE_DISABLED:
              wifiStateText = "WIFI_STATE_DISABLED";
              break;
          case WifiManager.WIFI_STATE_ENABLING:
              wifiStateText = "WIFI_STATE_ENABLING";
              break;
          case WifiManager.WIFI_STATE_ENABLED:
              wifiStateText = "WIFI_STATE_ENABLED";
              break;
          case WifiManager.WIFI_STATE_UNKNOWN:
              wifiStateText = "WIFI_STATE_UNKNOWN";
              break;
          default:
              break;
          }
          MyLog.d(TAG, "onReceive Broadcast &gt; WiFiState: " + wifiStateText);
          MyLog.d(TAG, "onReceive Broadcast &gt; Time: " + new Date());
      }
  }
  </code></pre>
  
  <p>I really hope to get some help. Thanks in advance.</p>