下面是代码:每当我从wifi或蜂窝网络,脱机或联机或在线OnReceive方法更改网络时,都不会被调用。
在AndroidManifest.xml
parse_number
NetworkStatusReceiver.java
<receiver
android:name=".offline.NetworkStatusReceiver"
android:enabled="true">
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
</intent-filter>
</receiver>