用于检测新网络可用性的广播接收器
我正在寻找在您的 Android 手机上检测到新网络时触发的意图操作。西娅有吗?我已经检查了文档,唯一接近的是 android.net.conn.CONNECTIVITY_CHANGE 我想编写一个广播接收器来侦听检测到的新网络。或者,您的 Android 手机检测到的网络是否有类似不稳定的内容提供商? 谢谢
I am looking to find an intent action that is fired when a new network is detected on your android phone. Is thea any? I have checked the documentation, the only one that is close is android.net.conn.CONNECTIVITY_CHANGE
I want to write a Broadcast receiver that listens to a new network detected. Alternatively is there like volatile a content provider for the networks your android phone detects?
Thanx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您想在您的 Android 设备连接到新网络时收到通知吗?在这种情况下,您需要使用
NETWORK_STATE_CHANGED_ACTION
。 这个问题at SO 处理类似的事情(尽管特定于 WiFi)。您可能会发现类似的东西来处理更高的抽象(即,网络代替 Wifi)。如果您想在 Android 设备发现新网络(即 AP)时收到通知,请尝试查看
WifiManager.SCAN_RESULTS_AVAILABLE_ACTION
。Do you want to be informed when your Android device connects to a new network? In that case you need to use
NETWORK_STATE_CHANGED_ACTION
. This question at SO deals with something similar (specific to WiFi though). You might find something similar to deal with a higher abstraction (i.e, Network in place of Wifi).If you want to be informed when a new network (i.e, AP) is visible to your Android device, try looking at
WifiManager.SCAN_RESULTS_AVAILABLE_ACTION
.