public static boolean changeWirelessState ( boolean state ) { try { WifiManager wifi = ( WifiManager ) QuickUtils . getContext ( ) . getSystemService ( Context . WIFI_SERVICE ) ; wifi . setWifiEnabled ( state ) ; return true ; } catch ( Exception e ) { return false ; } }
Set wireless connectivity On also this method will need the permissions android . permission . CHANGE_WIFI_STATE and android . permission . ACCESS_WIFI_STATE