mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-01 02:12:58 +08:00
Fixed a null error on NetworkManager
This commit is contained in:
parent
594e77690c
commit
693cb4695f
@ -32,9 +32,14 @@ public class NetworkManager {
|
|||||||
public boolean isWifiActive()
|
public boolean isWifiActive()
|
||||||
{
|
{
|
||||||
NetworkInfo info = sockMan.getActiveNetworkInfo();
|
NetworkInfo info = sockMan.getActiveNetworkInfo();
|
||||||
|
if(info != null)
|
||||||
|
{
|
||||||
String type = info.getTypeName();
|
String type = info.getTypeName();
|
||||||
return type.equals("WIFI");
|
return type.equals("WIFI");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isReachable(String uri)
|
public boolean isReachable(String uri)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user