BroadcastReceiver declared in manifest is not receiving the Broadcast
Your receiver in manifest should looks like this
<receiver android:name=".WifiReceiver" >
<intent-filter>
<action android:name="android.net.wifi.WIFI_STATE_CHANGED" />
</intent-filter>
</receiver>
Also the following permission may be needed
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
If your Target android version is more than Android O. if you declare receivers in manifest they wont work. So you need to register inside your activity.
Note: If your app targets API level 26 or higher, you cannot use the manifest to declare a receiver for implicit broadcasts (broadcasts that do not target your app specifically), except for a few implicit broadcasts that are exempted from that restriction. In most cases, you can use scheduled jobs instead.
Resource: https://developer.android.com/guide/components/broadcasts