title: BroadcastReceiver.onReceive not called, but Activity.onNewIntent do. Why?
body: <p>I am trying to get "DeleteIntent" callback from my notification.
  <strong>BroadcastReceiver.onReceive</strong> not called from PendengIntent, while it works OK when broadcast is launched manually with <strong>sendBroadcast(deleteIntent)</strong>.</p>
  
  <p>It works well when intent target is <strong>Activity</strong> (hits <strong>Activity.onNewIntent</strong>) but it is weird to use it since activity goes foreground when message dismissed.</p>
  
  <p>Please, help to get <strong>onReceive</strong> call to <strong>BroadcastReceiver</strong>.
  It is visible, exported and enabled, located in the same package.</p>
  
  <p><em>MyCancelReceiver class</em></p>
  
  <pre><code>public class MyCancelReceiver extends BroadcastReceiver {
      @Override
      public void onReceive(Context context, Intent intent) {
      }
  }
  </code></pre>
  
  <p><em>Android manifest</em></p>
  
  <pre><code>&lt;activity android:name=".MainActivity" android:launchMode="singleTask"&gt;
  
  &lt;MyCancelReceiver" android:enabled="true" android:exported="true"&gt;
      &lt;intent-filter&gt;
          &lt;action android:name="notification_cancelled"/&gt;
      &lt;/intent-filter&gt;
  &lt;/receiver&gt;
  </code></pre>
  
  <p><em>MainActivity</em></p>
  
  <pre><code>private MyCancelReceiver mReceiver;
  
  @Override
  public void onStart() {
      super.onStart();
  
      IntentFilter filter = new IntentFilter();
      filter.addAction("notification_cancelled");
      mReceiver = new MyCancelReceiver();
      registerReceiver(mReceiver, filter);
  }
  
  @Override
  public void onStop() {
      super.onStop();       
      unregisterReceiver(mReceiver);
  }
  </code></pre>
  
  <p><em>Notification creation:</em></p>
  
  <pre><code>Intent cancelIntent = new Intent(getApplicationContext(), MyCancelReceiver.class);
  cancelIntent.setAction("notification_cancelled");
  cancelIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  PendingIntent deleteIntent = PendingIntent.getActivity(getApplicationContext(), 0, cancelIntent, PendingIntent.FLAG_CANCEL_CURRENT);
  
  Notification not = new Notification.Builder(getApplicationContext(), Util.ANDROID_CHANNEL_ID)
          .setContentTitle(messageTitle)
          .setContentText(messageBody)
          .setSmallIcon(R.drawable.default)
          .setAutoCancel(true)
          .setDeleteIntent(deleteIntent)
          .setContentIntent(contentIntent)
          .build();
  
  NotificationManager notificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);
  notificationManager.notify(0, not);
  </code></pre>
  
  <p>Thank you in advance.</p>