Enable and Disable Wi-Fi in android in code

by Sasikumar 2013-10-19 10:53:12

To enable Wi-Fi in android use the following code:
WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
wifi.setWifiEnabled(true);

To disable Wi-Fi in android use the following code:
WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
wifi.setWifiEnabled(false);
945
like
0
dislike
0
mail
flag

You must LOGIN to add comments