turn Wifi On - Android Wifi

Android examples for Wifi:Wifi Connection

Description

turn Wifi On

Demo Code


//package com.java2s;

import android.content.Context;

import android.net.wifi.WifiManager;

public class Main {
    private static void turnWifiOn(Context c) {
        getWifiManager(c).setWifiEnabled(true);
    }/*ww w .j  a va2 s  .co m*/

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

Related Tutorials