Monday, July 16, 2012

Turn Android Wifi On/Off


To turn Wifi ON:

WifiManager wifiManager = (WifiManager)getBaseContext().getSystemService(Context.WIFI_SERVICE);
wifiManager.setWifiEnabled(true);

To turn Wifi OFF:

WifiManager wifiManager = (WifiManager)getBaseContext().getSystemService(Context.WIFI_SERVICE);
wifiManager.setWifiEnabled(false);

No comments:

Post a Comment