code: @RequiresPermission(ACCESS_WIFI_STATE) public static Observable<WifiState> observeWifiStateChange(
        final Context context) {
      final IntentFilter filter = new IntentFilter();
      filter.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION);
  
      return Observable.create(new ObservableOnSubscribe<WifiState>() {
        @Override public void subscribe(final ObservableEmitter<WifiState> emitter) throws Exception {
          final BroadcastReceiver receiver = createWifiStateChangeReceiver(emitter);
          context.registerReceiver(receiver, filter);
          Disposable disposable = disposeInUiThread(new Action() {
            @Override public void run() {
              tryToUnregisterReceiver(context, receiver);
            }
          });
  
          emitter.setDisposable(disposable);
        }
      });
    }
docs: Observes WiFi State Change Action
  Returns wifi state
  whenever WiFi state changes such like enable,disable,enabling,disabling or Unknown
  
  @param context Context of the activity or an application
  @return RxJava Observable with different state change