I have a service which contains a Broadcast Receiver that looks for Wi-Fi state change and makes a toast when enabled or disabled. But, my code does not toast the wi-fi state change messages though it toasts the messages related to service create, start and destroy. 
WLANService.java
    public class WLANService extends Service {
    public WLANService() {
    }
    @Override
    public IBinder onBind(Intent intent) {
        throw new UnsupportedOperationException("Not yet implemented");
    }
    @Override
    public void onCreate() {
        super.onCreate();
        Toast.makeText(this, "Service Created!", Toast.LENGTH_LONG).show();
    }
    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        int state = 0;
        String message = intent.getStringExtra("message");
        Toast.makeText(this, "Service Started & " + message, Toast.LENGTH_LONG).show();
        BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
            @Override
            public void onReceive(Context context, Intent intent) {
                WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
                if(wifiManager.isWifiEnabled()) {
                    Log.i("Wi-Fi-State", "Wi-Fi is On!");
                }else {
                    Log.i("Wi-Fi-State", "Wi-Fi is Off!");
                }
            }
        };
        return START_STICKY;
    }
    @Override
    public void onDestroy() {
        Toast.makeText(this, "Service Destroyed!", Toast.LENGTH_LONG).show();
    }
}
MainActivity.java
    public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
    public void startTheService(View v) {
        Intent intent = new Intent(this, WLANService.class);
        intent.putExtra("message", "I got your message!");
        startService(intent);
    }
    public void stopTheService(View v) {
        stopService(new Intent(this, WLANService.class));
    }
}
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.wifiservice">
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <service
            android:name=".WLANService"
            android:enabled="true"
            android:exported="false">
        </service>
    </application>
</manifest>
