CeccoCQ CeccoCQ - 4 years ago 165
Android Question

Check INTENT internet connection

There is an Android

Intent
ACTION_XXX that notify me when Internet Connection is available?
I would to instantiate a
BroadcastReceiver
that notify my application when user enable Internet Connection (by wifi, by GSM, etc...)

Could anyone help me?

Answer Source
<receiver android:name=".YOURRECEIVER">
   <intent-filter>
      <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
   </intent-filter>
</receiver>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download