vendredi 8 mai 2015

android.net.conn.CONNECTIVITY_CHANGE broadcast receiver not fires in JellyBean for VPN connection and disconnection

This is 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"));

    }

}

The ConnectivityModifiedReceiver will send intents according to network connectivity change.In my case VPN connection and disconnection.

I am getting intents in Lollipop But not in JellyBean.

Plz help

Aucun commentaire:

Enregistrer un commentaire