PHP
·
发表于 5年以前
·
阅读量:8282
public static boolean isWifiConnected(Context context) {
ConnectivityManager connectivityManager = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo wifiNetworkInfo = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
if (wifiNetworkInfo.isConnected()) {
return true;
}
return false;
}