I am trying to turn add a wifi network programmatically and to connect to that network.
My code works fine if the wi-fi is already turned on.
If wi-fi is off
You need to create wifiLock with wifi mode_full, a bit strange name for that method but doing the work.