title: Wifi scan results broadcast receiver not working
body: <p>I have written a simple broadcast receiver to show a toast message when wifi scan is completed. Nothing is showing. Here is my code:</p>
  
  <pre><code>package com.wifi;
  
  import java.util.List;
  
  import android.content.BroadcastReceiver;
  import android.content.Context;
  import android.content.Intent;
  import android.net.wifi.ScanResult;
  import android.net.wifi.WifiManager;
  import android.widget.Toast;
  
  public class wifiReceiver extends BroadcastReceiver {
      @Override
      public void onReceive(Context context, Intent intent) {
          Toast.makeText(context,"Scan completed", Toast.LENGTH_LONG).show();
  
      }
  
  }
  </code></pre>
  
  <p>Here is the manifest file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.wifi"
        android:versionCode="1"
        android:versionName="1.0"&gt;
  
  
      &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt;
          &lt;activity android:name=".wifi" android:label="@string/app_name"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;receiver android:name=".wifiReceiver"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.net.wifi.SCAN_RESULTS"&gt;&lt;/action&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
      &lt;/application&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /&gt;
      &lt;uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /&gt;
  &lt;/manifest&gt;
  </code></pre>