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);
}