And then will try to change settings by,
mWm.setWifiEnabled(false/true) to toggle wifi.
You can go all fancy to check the result by using getWifiState() to get better state of your wifi instead of isWifiEnabled()
full java code :