title: BroadcastReceiver onReceive() not Called when registered dynamically
body: <p>The function "onReceive" is called when BroadcastReceiver is Registered in the Manifest but  <strong>NOT</strong> called if registered dynamically.</p>
  
  <p>The code that works is below:</p>
  
  <pre><code>public class EyeGesture extends BroadcastReceiver {
      //Eye Gesture
      private static IntentFilter eyeGestureIntent;
      private static Context eyeGestureContext;
      private static StringBuilder gestureInfo = null;
      private static BroadcastReceiver broadcastReceiver;
  
     // public void startEyeListening() {
          //Eye Gesture
  
      //}
  
      @Override
      public void onReceive(Context context, Intent intent) {
         // this = context;
          if (intent.getStringExtra("gesture").equals("WINK")) {
              Log.e("WINKED ","");
          }else {
              Log.e("SOMETHING", "is detected " + intent.getStringExtra("gesture"));
          }
          //Disable Camera Snapshot
         // abortBroadcast();
  
      }
  
      public void stopEyeListening() {
          eyeGestureContext.unregisterReceiver(broadcastReceiver);
          eyeGestureIntent = null;
          eyeGestureContext = null;
          gestureInfo = null;
      }
  
  }
  </code></pre>
  
  <p>Below is the Manifest file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.inno.inno.glassplugin" &gt;
  
      &lt;uses-permission android:name="com.google.android.glass.permission.DEVELOPMENT" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;activity
              android:name=".MainFunct"
              android:icon="@drawable/ic_glass_logo"
              android:label="@string/title_activity_main_funct" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.google.android.glass.action.VOICE_TRIGGER" /&gt;
              &lt;/intent-filter&gt;
              &lt;meta-data
                  android:name="com.google.android.glass.VoiceTrigger"
                  android:resource="@xml/voice_trigger" /&gt;
          &lt;/activity&gt;
  
          &lt;receiver android:name="com.inno.inno.glassplugin.EyeGesture"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.google.android.glass.action.EYE_GESTURE" /&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>The problem is that "onReceive" is <strong>NOT</strong> called when registered dynamically. I have to do this in a dynamic way. 
  Below is the code that is <strong>NOT</strong> working code.</p>
  
  <pre><code>public class EyeGesture extends Activity {
      //Eye Gesture
      IntentFilter eyeGestureIntentFilter;
      Context eyeGestureContext;
      BroadcastReceiver broadcastReceiver;
  
  
      public  EyeGesture(){
          Log.e("CONSTRUCTOR ", "");
          eyeGestureContext = MainFunct.getCurrentContext();
          eyeGestureIntentFilter = new IntentFilter("com.google.glass.action.EYE_GESTURE");
          eyeGestureIntentFilter.setPriority(1000);
          startRunning();
      }
  
      void startRunning(){
          eyeGestureContext.registerReceiver(new BroadcastReceiver() {
              @Override
              public void onReceive(Context context, Intent intent) {
                  Log.e("Received ", " Something");
              }
          },eyeGestureIntentFilter);
      }
  
  
      @Override
      public  void onResume(){
          super.onResume();
      }
  
      @Override
      public  void  onPause(){
          super.onPause();
          unregisterReceiver(broadcastReceiver);
      }
      public void stopEyeListening() {
          eyeGestureContext.unregisterReceiver(broadcastReceiver);
          eyeGestureIntentFilter = null;
          eyeGestureContext = null;
      }
  
  }
  </code></pre>
  
  <p>Also, I don't want to extend BroadcastReceiver from this class. Why am I not receiving anything if registered dynamically. I also removed the following line from the Manifest:</p>
  
  <pre><code> &lt;receiver android:name="com.inno.inno.glassplugin.EyeGesture"&gt;
                  &lt;intent-filter&gt;
                      &lt;action android:name="com.google.android.glass.action.EYE_GESTURE" /&gt;
                  &lt;/intent-filter&gt;
   &lt;/receiver&gt;
  </code></pre>
  
  <p>but still, it is not working. There is no error or exception thrown.
  What am I doing wrong?</p>