-
Notifications
You must be signed in to change notification settings - Fork 0
Home
SFKiller edited this page Oct 26, 2015
·
4 revisions
Welcome to the NetworkStateMonitor wiki!
1、Copy java files, in src folder, to your project;
2、In your AndroidManifest.xml:
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
......
<receiver android:name="you.package.name.NetworkStateReceiver">"
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
</intent-filter>
</receiver>
3、Where you want to monitor network state, like an activity, just do like this:
NetworkStateReceiver.handlerList.add(context);