How to disable WIFI Auto-connect in Android

Nimit  picture Nimit · Oct 22, 2012 · Viewed 69.5k times · Source

Android saves WIFI details into WifiConfiguration class. When WIFI is ON and SSID, Pass-key details matches with WIFI network then Android auto connect with the particular WIFI Network. How to disable that auto-connect feature ? purpose behind asking this question is, I have two configured networks (already saved) and i want to connect WIFI on the button click event, but auto connect feature of android connects with the WIFI itself.

Answer

Vikram Gupta picture Vikram Gupta · Oct 22, 2012

No. You cannot do this. The OS keeps track of the networks which are configured in the device. It tries to find those networks and based on the priority driven method, chooses an appropriate network and connects to it as soon as WiFi is turned on. As Arpit suggested, you can forget those networks and OS will remove it's configuration from memory.