Closed asknask closed 2 years ago
Describe the bug The value is always false, even if internet is connected. The observer also doesn't get triggered if I change network state by turning off wifi and data.
To Reproduce
InternetObservingSettings settings = InternetObservingSettings.builder() .initialInterval(0) .interval(5000) .strategy(new SocketInternetObservingStrategy()) .build(); disposable = ReactiveNetwork .observeInternetConnectivity(settings) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(isConnectedToInternet -> { isInternetConnected = isConnectedToInternet; if(!isInternetConnected) { Toasty.warning(getApplicationContext(), R.string.not_connected_internet).show(); } }); } @Override public void onTerminate() { super.onTerminate(); if(disposable != null && !disposable.isDisposed()) { disposable.dispose(); } }
Expected behavior isConnectedToInternet should return true. Observer should be triggered if internet is not connected.
Smartphone (please complete the following information):
Describe the bug The value is always false, even if internet is connected. The observer also doesn't get triggered if I change network state by turning off wifi and data.
To Reproduce
Expected behavior isConnectedToInternet should return true. Observer should be triggered if internet is not connected.
Smartphone (please complete the following information):