WifiManager wifiManager = (WifiManager) mContext.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
wifiManager.setWifiEnabled(true); //开启wifi
wifiManager.setWifiEnabled(false); //关闭wifi
int status = wifiManager.getWifiState(); //获取开关状态,1-关闭,3-开启
Android 获取Wifi开关状态、控制Wifi开关
猜你喜欢
转载自blog.csdn.net/qq_27494201/article/details/131224679
今日推荐
周排行