Code example for WifiManager

Methods: enableNetwork

0
            alert.setView(input); 
            alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() { 
                    public void onClick(DialogInterface dialog, int whichButton) {
                    Editable value = input.getText();
                    netid =  Integer.parseInt(value.toString());
                    mWifiManager.enableNetwork(netid, false);
                    } 
                    }); 
            alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int whichButton) {
                    // Canceled. 
                    } 
                    }); 
            alert.show(); 
        } 
        return true; 
    } 
} 
Contextual code suggestions in your IDE  Get Codota for Java