Add isConnected, enable NSClient only, if really connected to internet
This commit is contained in:
parent
3f1469b211
commit
b0d8d547d8
|
@ -36,7 +36,7 @@ public class NetworkChangeReceiver extends BroadcastReceiver {
|
|||
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
|
||||
|
||||
if (activeNetwork != null) {
|
||||
if (activeNetwork.getType() == ConnectivityManager.TYPE_WIFI) {
|
||||
if (activeNetwork.getType() == ConnectivityManager.TYPE_WIFI && activeNetwork.isConnected()) {
|
||||
event.wifiConnected = true;
|
||||
WifiManager wifiManager = (WifiManager) MainApp.instance().getApplicationContext().getSystemService(Context.WIFI_SERVICE);
|
||||
if (wifiManager != null) {
|
||||
|
|
Loading…
Reference in a new issue