I am implementing a Broadcast receiver inside a service which is supposed to be listening for internet connection availability. The service is started from the main activity of the application. The problem is that the broadcast listener does not actually listen to anything. My code is :

```
public class MyService extends Service {

public final static String SEND_DATA_BROADCAST = "com.myapp.SEND_DATA"; 
private final static String LOG_TAG="-Service-";
private BroadcastReceiver   updateListener;

@Override
public void onCreate()
{
    super.onCreate();

    //create listener

     final IntentFilter theFilter = new IntentFilter();
        theFilter.addAction(SEND_DATA_BROADCAST);
        this.updateListener = new BroadcastReceiver() {

            @Override
            public void onReceive(Context context, Intent intent) {
                // Do whatever you need it to do when it receives the broadcast
                // Example show a Toast message...
                Log.d(LOG_TAG,"Listening..");
            }
        };

    // register listener
    Log.d(LOG_TAG,"Registering Listener");
    this.registerReceiver(this.updateListener, theFilter);
    listenerRegistered = true;
    Log.d(LOG_TAG,"Listener Registered");
}

```