turn Wifi Off - Android Wifi

Android examples for Wifi:Wifi Connection

Description

turn Wifi Off

Demo Code


//package com.java2s;

import android.content.Context;

import android.net.wifi.WifiManager;

public class Main {
    private static void turnWifiOff(Context c) {
        getWifiManager(c).setWifiEnabled(false);
    }/*from  www  . j  a v  a  2 s.  co m*/

    private static WifiManager getWifiManager(Context c) {
        return (WifiManager) c.getSystemService(Context.WIFI_SERVICE);
    }
}

Related Tutorials