This is the way you do what you need:
WifiManager wifiManager =(WifiManager)this.context.getSystemService(Context.WIFI_SERVICE);
wifiManager.setWifiEnabled(status);
You will need some extra permissions.
uses-permission android:name="android.permission.CHANGE_WIFI_STATE"
Take on count that this might not be a good android practice, usually you would like the user to explicitly enable/disable it, so instead of programatically forcing wifi to do so, you should pop the settings activity so the user does it him self.
Regards!