android.net.wifi.STATE_CHANGE: not triggered on Wifi disconnect

前端 未结 2 1984
渐次进展
渐次进展 2020-12-23 12:54

Is it normal to only have a broadcast intent with action NETWORK_STATE_CHANGED_ACTION (whose constant value is android.net.wifi.STATE_CHANGE) when

2条回答
  •  醉酒成梦
    2020-12-23 13:32

    public static final String SUPPLICANT_CONNECTION_CHANGE_ACTION

    Since: API Level 1

    Broadcast intent action indicating that a connection to the supplicant has been established (and it is now possible to perform Wi-Fi operations) or the connection to the supplicant has been lost. One extra provides the connection state as a boolean, where true means CONNECTED.

    See Also

    EXTRA_SUPPLICANT_CONNECTED

    Constant Value: "android.net.wifi.supplicant.CONNECTION_CHANGE"

    In android's API it says that it's not a good idea to check STATE_CHANGE for network connectivity and instead you should use SUPPLICANT_CONNECTION_CHANGE_ACTION. this will notice an establishment to a wifi network, and the disconnection of a wifi network. I don't know if this might help you, but I do hope so. LINK

提交回复
热议问题