title: Android: Register Receiver in Library
body: <p>I have a library that includes an activity named as <code>BaseActivity</code> and a receiver named as <code>BaseRegister</code>. </p>
  
  <p><code>BaseRegister</code> extends <code>BroadcastReceiver</code> and its actions are <code>android.net.conn.CONNECTIVITY_CHANGE</code> and <code>android.net.wifi.WIFI_STATE_CHANGED</code> and it looks like:</p>
  
  <pre><code>public class BaseRegister extends BroadcastReceiver {
      @Override
      public void onReceive(Context context, Intent intent) {
          if {
              Log.d("onReceive", "Got it"); // Works
              context.sendBroadcast(new Intent("some"));
          else {
              Log.d("onReceive", "Nope"); // Works
              context.sendBroadcast(new Intent("stuff"));
          }
      }
  }
  </code></pre>
  
  <p><code>AndroidManifest</code> is fine too, according to <code>Log</code>. Here is how <code>BaseActivity</code> looks like: </p>
  
  <pre><code>public class BaseActivity extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          registerReceiver(applicationControl, new IntentFilter("some"));
          registerReceiver(applicationControl, new IntentFilter("stuff"));
      }
  
      private BroadcastReceiver applicationControl = new BroadcastReceiver() {
          @Override
          public void onReceive(Context context, Intent intent) {
              if (intent.equals(new Intent("some"))) {
                  some();
              } else if (intent.equals(new Intent("stuff"))) {
                  stuff();
              }
          }
      };
  
      public void some() { /** logging etc **/ }
      public void stuff() { /** logging etc **/ }
  
  
  }
  </code></pre>
  
  <p>In project, I've already added this project as a library, no problem. And created an Activity which extends <code>BaseActivity</code>. When <code>CONNECTIVITY_CHANGE</code> as an action, <code>BaseRegister</code> triggered by Android, but there is no call for Activity. Here is how my project looks:</p>
  
  <pre><code>public class AnyActivity extends BaseActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  }
  
      @Override
      public void some() {
          super.some();
          Log.d("abc", "abc"); // not working
      }
  
  
      @Override
      public void stuff() {
          super.stuff(); 
          Log.d("abc", "abc"); //not working
      }
  
  }
  </code></pre>
  
  <p>What is wrong? Is my approach improper or does any error exist? Any help would be great.</p>