You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
my app was being used successfully observeWifiAccessPoints and observeConnectivity and suddenly observeWifiAccessPoints has stopped working (now never goes to "call" procedure).
This is my code:
@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);
}
});
}
The text was updated successfully, but these errors were encountered:
Thank you for reporting the issue.
Does it happen all the time? I think it may be related to bug or bad design of Android SDK. I've seen on StackOverflow that people have similar problems with WiFi scanning.
It looks that problem was caused by lack of WifiManager.SCAN_RESULTS_AVAILABLE_ACTION filter for BroadcastReceiver. Now it should work fine. Moreover, I've slightly updated sample app.
Fix will be available in the next release. If you want to verify it now, you can clone repository and check sample app.
my app was being used successfully observeWifiAccessPoints and observeConnectivity and suddenly observeWifiAccessPoints has stopped working (now never goes to "call" procedure).
This is my code:
The text was updated successfully, but these errors were encountered: