发射打开wifi

阅读更多
WifiManager wifiManager = (WifiManager) getBaseContext()
            .getSystemService(Context.WIFI_SERVICE);
          wifiManager.setWifiEnabled(false);
try {
    wifiManager.getClass()
            .getMethod("setWifiApEnabled",
                               WifiConfiguration.class,
                               boolean.class)
        .invoke(wifiManager, null, false);
} catch (Exception e) {
    Log.e(Main.TAG, "Cannot call: setWifiApEnabled", e);
}

 

你可能感兴趣的:(发射打开wifi)