Android - Correct way to detect disconnecting from a particular wifi ssid?

前端 未结 4 2134
梦毁少年i
梦毁少年i 2021-02-06 16:02

I\'ve seen a couple of BroadcastReciever examples to detect wifi disconnects but none of them seem to work correctly (triggering twice for each disconnect for example) and none

4条回答
  •  深忆病人
    2021-02-06 16:52

    Are you sure there are twice notification for same state? There are always two phase of disconnection:

    WifiManager.WIFI_STATE_DISABLING

    WifiManager.WIFI_STATE_DISABLED

提交回复
热议问题