I want to get notified when the device connects or disconnects from the internet to perform update.I've put this code in the manifest file :
<receiver android:name=".Conectivity" android:enabled="true" android:exported="true">
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE"></action>
</intent-filter>
And here is my Conectivity class:
package com.funny.pack;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
public class Conectivity extends BroadcastReceiver {
@Override
public void onReceive(Context arg0, Intent arg1) {
Log.w("DHA", "Ceva e diferit la conectivitate");
}
}
Horewer i am not notified when the device connects or disconnects from the internet I think this broadcast receiver must be implemented only from code is that right ? Is there a list of broadcast receivers that cand be implemented from the manifest file and vice versa ?