my app was being used successfully observeWifiAccessPoints and observeConnectivity and suddenly observeWifiAccessPoints has stopped working (now never goes to "call" procedure).
@Override
protected void onResume() {
super.onResume();
// Register interest for two different actions related to power
registerReceiver(powerMonitor, new IntentFilter("android.intent.action.ACTION_POWER_CONNECTED"));
registerReceiver(powerMonitor, new IntentFilter("android.intent.action.ACTION_POWER_DISCONNECTED"));
reactiveNetwork = new ReactiveNetwork();
reactiveNetwork.observeConnectivity(this)
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.io())
.subscribe(new Action1<ConnectivityStatus>() {
@Override
public void call(ConnectivityStatus connectivityStatus) {
Toast.makeText(MainActivity.this, "connectivityStatus", Toast.LENGTH_SHORT).show();
tvConnectivityStatus.setText(connectivityStatus.toString());
}
});
reactiveNetwork.observeWifiAccessPoints(this)
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.io())
.subscribe(new Action1<List<ScanResult>>() {
@Override
public void call(List<ScanResult> scanResults) {
Toast.makeText(MainActivity.this, "observeWifiAccessPoints", Toast.LENGTH_SHORT).show();
displayAccessPoints(scanResults);
}
});
}