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

@param state   - set enable or disable wireless connection
@return true if was set successfully and false if it wasn't