title: Registering to Same Receiver Multiple times
body: <p>For some reason I need to register to same receiver multiple times like one in the Manifest and one time in the code. I want to listen package changes even the app is not running but installed. </p>
  
  <p>1.In the AndroidManifest.xml</p>
  
  <pre><code>&lt;receiver android:name="PackageChangeReceiver"&gt;
      &lt;intent-filter&gt;
          &lt;action android:name="android.intent.action.PACKAGE_CHANGED" /&gt;
          &lt;action android:name="android.intent.action.PACKAGE_ADDED" /&gt;
          &lt;action android:name="android.intent.action.PACKAGE_REMOVED" /&gt;
          &lt;action android:name="android.intent.action.PACKAGE_REPLACED" /&gt;
          &lt;data android:scheme="package" /&gt;
      &lt;/intent-filter&gt;
  </code></pre>
  
  <p></p>
  
  <p>2.Also in the code I register to BroadcastReceiver with the following code snippet in the constructor of.</p>
  
  <pre><code>public PackageChangeReceiver(@ForApplication Context context) {
      super();
      IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_ADDED);
      filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
      filter.addAction(Intent.ACTION_PACKAGE_CHANGED);
      filter.addDataScheme("package");
      context.registerReceiver(this, filter);
  }
  </code></pre>
  
  <p>But somehow Android only receives one of them intermittently sometime it receives both. Is there any doc in the newer versions like a performance improvement in Android OS itself such as only receiving one broadcast although registered to multiple times. Is it device or OS or version specific thing?</p>