Code example for WifiManager

Methods: disconnectremoveNetwork

0
  } 
 
  private int doError(int resource_string) {
    statusView.setText(resource_string);
    // Give up on the connection 
    wifiManager.disconnect();
    if (networkId > 0) {
      wifiManager.removeNetwork(networkId);
      networkId = -1;
    } 
    if (receiverRegistered) {
      unregisterReceiver(wifiReceiver);
      receiverRegistered = false;
    } 
    return -1; 
  } 
 
  private WifiConfiguration changeNetworkCommon(NetworkSetting input){
    statusView.setText(R.string.wifi_creating_network);
    Log.d(TAG, "Adding new configuration: \nSSID: " + input.getSsid() + "\nType: " +
        input.getNetworkType());