I register the receiver on onResume() :
registerReceiver(wifiConnectivityReceiver, new IntentFilter(WifiManager.SUPPLICANT_CONNECTION_CHANGE_ACTION));
This is the receiver itself:
class WiFiConnectivityReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if (intent.getBooleanExtra(WifiManager.EXTRA_SUPPLICANT_CONNECTED,false)){ Log.d(TAG,"Connected to network!"); } else { Log.d(TAG,"Could not connect to network!"); } } }
In my application, I can connect to the selected WiFi network, but this SUPPLICANT_CONNECTION_CHANGE_ACTION never starts. If I change it to SUPPLICANT_STATE_CHANGED_ACTION , for example, it works.
I am working on ICS.
Has anyone else encountered such problems with this intention?
source share