I'm associating a Nexus 5x running MarshMallow 6.0 to a Wi-Fi hotspot that has no Internet access. Android keeps dropping the connection every second and then won't even try to reconnect stating that there is no Internet access.

How can I force Android to keep this Wi-Fi connection even without Internet access?

  • 2
    On my Nexus 5X, when I connect to hotspot with no internet access, after a few seconds I get a notification asking if I want to stay connected to it. When I answer Yes, it stays connected. If I anser no, hotspot gets disconnected. – Juozas Kontvainis Dec 11 '15 at 12:10
up vote 9 down vote accepted

This shell command works on marshmallow: type su to enter superuser mode. Then type the following command: settings put global captive_portal_detection_enabled 0

^^ it disables the "drop wifi if no internet connection" functionality.

  • This is actually a very good answer. My problem was a mistake of gateway but I'm getting the message. To disable the message, this setting is efficient. It only needs root access to be persistent across reboot. – gregoiregentil Jun 15 '16 at 19:51
  • This is perfect! Couldn't connect to my quad's wifi network consistently because Android kept handing it off despite checking the "ignore" box. – Sirens Jan 28 '17 at 21:25
  • 2
    This doesn't appear to work on Nougat. – seagull Feb 23 '17 at 11:29
  • Please note: I had to manually delete the network configs and add them manually, to get the issue fixed with the command (Samsung Galaxy Tab A T585). My Galaxy S8 Android N (25) provides a solid connection out of the box. – Martin Pfeffer May 28 '17 at 14:46
  • @MartinPfeffer did you find a way to add it programmatically to the network config (as in developer.android.com/training/articles/security-config) ? – Gabor Apr 27 at 20:28

My gateway was not correct. False problem. It's true that Android offers a message as stated in the question comment by Juozas.

To disable automatically disconnecting from a "poor" WiFi network, you will want to toggle the Avoid poor Wi-Fi connections setting.

This can usually be found in Settings > Wi-Fi > [menu] > Advanced > Avoid poor Wi-Fi connections.

  • 1
    "bad Wi-Fi" is certainly not a Google wording... Here support.google.com/nexus/answer/2819519#advanced, they mention "Avoid poor connections". I don't have that option on Nexus7 2013 5.1, nor on Nexus 5x 6.0. And I don't think that it would even answer my question. No Internet access is different from poor connection. – gregoiregentil Dec 10 '15 at 4:58

protected by Community Jun 21 '17 at 8:44

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.