ReactiveNetwork icon indicating copy to clipboard operation
ReactiveNetwork copied to clipboard

java.lang.IllegalArgumentException: intervalInMs is not a positive number

Open Mokardder opened this issue 8 months ago • 1 comments

   InternetObservingSettings settings = InternetObservingSettings.builder()
            .interval(20 * 1000)
            .strategy(new SocketInternetObservingStrategy())
            .build();

    try {
        internetDisposable = ReactiveNetwork.observeInternetConnectivity(settings)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(isConnected -> {

                    if (isConnected) {
                        Utility.sendAnyUnsentDAC(getApplicationContext());
                    }
                });
    } catch (Exception e) {
        Log.e(Utility.TAG, "Error observing connectivity: " + e.getMessage(), e);
    }  

Log ---------------------------------

java.lang.IllegalArgumentException: intervalInMs is not a positive number at com.github.pwittchen.reactivenetwork.library.rx2.Preconditions.checkGreaterThanZero(Preconditions.java:65) at com.github.pwittchen.reactivenetwork.library.rx2.internet.observing.strategy.SocketInternetObservingStrategy.observeInternetConnectivity(SocketInternetObservingStrategy.java:53) at com.github.pwittchen.reactivenetwork.library.rx2.ReactiveNetwork.observeInternetConnectivity(ReactiveNetwork.java:149) at com.github.pwittchen.reactivenetwork.library.rx2.ReactiveNetwork.observeInternetConnectivity(ReactiveNetwork.java:123) at android.iocl.dac_collector.Ui.MainActivity.observeConnectivity(MainActivity.java:556) at android.iocl.dac_collector.Ui.MainActivity.onCreate(MainActivity.java:109) at android.app.Activity.performCreate(Activity.java:8130) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1357)

Mokardder avatar Feb 08 '25 13:02 Mokardder