+ Reply to Thread
Results 1 to 2 of 2

Thread: Enable/Disable WIFI

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    28

    Enable/Disable WIFI

    I`d like to know how can i enable and/or disable WIFI through code.

    Thanks.

  2. #2
    Junior Member
    Join Date
    Jan 2012
    Posts
    45
    Code:
    // Enable
    ((WifiManager) getSystemService(WIFI_SERVICE)).setWifiEnabled(true)
      
    // Disable
    ((WifiManager) getSystemService(WIFI_SERVICE)).setWifiEnabled(false)
    Another Example :
    Code:
    // Enable
    WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
    wifi.setWifiEnabled(enabled);
    
    // Disable
    WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
    wifi.setWifiEnabled(disabled);

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts