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

标签 android wifi wifimanager

当 Wifi 连接恢复时,仅具有带有操作 NETWORK_STATE_CHANGED_ACTION 的广播 Intent (其常量值为 android.net.wifi.STATE_CHANGE)是否正常? IE。当 Wifi 断开连接时,我没有得到这个 Intent 。

更新:我最感兴趣的是 >= 2.2 Froyo

最佳答案

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"

在 android 的 API 中,它说检查网络连接的 STATE_CHANGE 不是一个好主意,您应该使用 SUPPLICANT_CONNECTION_CHANGE_ACTION。这将通知 wifi 网络的建立,以及 wifi 网络的断开。我不知道这是否对你有帮助,但我希望如此。 LINK

关于android.net.wifi.STATE_CHANGE : not triggered on Wifi disconnect,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5365395/

相关文章:

ios - 在 iOS 4.0 及以上版本扫描和切换 Wifi 网络

ios - 以编程方式从 iPhone/iPad 连接到采集单元(WIFI 设备)

java - 通过低功耗蓝牙(即通过信标)向附近的移动设备发送通知,且设备上未安装任何应用程序

android - 检查 ScanResult 网络是否已配置(存在于 getConfiguredNetworks() 列表中)

android - 从 Marker 打开 URL,Android 谷歌地图 V2

android - 过滤带前缀号码的联系人

android - 如何在 Xamarin.Forms 中设置 ContentPage 方向

Android 棉花糖 WifiManager 泄漏 IntentReceiver

java - Android Oreo,wifiManager.getScanResults() 在 Doze 中返回空列表

android - Universal ImageLoader 的缓存文件夹在哪里?