This is the manifest part
<receiver android:name="my.com.app.ConnectivityModifiedReceiver" android:label="NetworkConnection" > <intent-filter> <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> </intent-filter> </receiver>
This is java code
public class my.com.app.ConnectivityModifiedReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { context.sendBroadcast(new Intent("ConnectivityModified")); } }
ConnectivityModifiedReceiver will send intentions according to the change in network connection. In my case, connecting and disconnecting a VPN.
I get intentions at Lollipop, but not at JellyBean.
Help Plz
source share