Android 判断wifi是否打开

/**
 * 检查wifi是否可用
 */
private boolean checkWifiIsEnable() {
    WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
    return null != wifiManager && wifiManager.isWifiEnabled();
}

你可能感兴趣的:(Android 判断wifi是否打开)