Merge pull request #1030 from triplem/wifi_connection
Add isConnected, enable NSClient only, if really connected to internet
This commit is contained in:
commit
3f568c2724
1 changed files with 1 additions and 1 deletions
|
@ -36,7 +36,7 @@ public class NetworkChangeReceiver extends BroadcastReceiver {
|
||||||
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
|
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
|
||||||
|
|
||||||
if (activeNetwork != null) {
|
if (activeNetwork != null) {
|
||||||
if (activeNetwork.getType() == ConnectivityManager.TYPE_WIFI) {
|
if (activeNetwork.getType() == ConnectivityManager.TYPE_WIFI && activeNetwork.isConnected()) {
|
||||||
event.wifiConnected = true;
|
event.wifiConnected = true;
|
||||||
WifiManager wifiManager = (WifiManager) MainApp.instance().getApplicationContext().getSystemService(Context.WIFI_SERVICE);
|
WifiManager wifiManager = (WifiManager) MainApp.instance().getApplicationContext().getSystemService(Context.WIFI_SERVICE);
|
||||||
if (wifiManager != null) {
|
if (wifiManager != null) {
|
||||||
|
|
Loading…
Reference in a new issue