Notification deleteIntent does not work

I’ve read several questions concerning similair issues, but they do not provide me with the solution.

In my Android app I fire off a notification (in the Application class to be specific, which is actually started from a C2DM push event).

  • IoT request response protocol
  • Error Compiling com.squareup.retrofit:converter-simplexml:2.0.0-beta2
  • Trouble installing Android 4.2 APIs
  • Android OpenCV Drawing Hough Lines
  • How to remove app title from toolbar?
  • AlertDialog with EditText, open soft keyboard automatically with focus on EditText doesn't work
  • I then want to receive an Intent when the “clear all” button is pressed on the notifications:

    notification.deleteIntent = PendingIntent.getService(this, 0, new Intent(this, NotificationDeleteReceiver.class), 0);

    In my NotificationDeleteReceiver.class I got the onReceive method:

    public class NotificationDeleteReceiver extends BroadcastReceiver {
        public void onReceive(Context context, Intent intent) {

    In my manifest file I got:

    <receiver android:name="NotificationDeleteReceiver">

    But still onReceive does not get called. What could I be doing wrong? Is there any smart way to debug and see if an Intent really is fired?

    Do I need some kind of intent filter or should it be fine?

    Any tips welcome.

    Related posts:

    The Android emulator is out of view, how can I move it?
    Keep tiles visible while loading TileOverlay Map API v2 Android
    What is the best IDE for java android development
    Get SHA1 fingerprint certificate in Android Studio for Google Maps
    Size of a canvas
    How to create modal dialog box in android
  • OnClickListener on scrollView
  • java.lang.IllegalArgumentException: View not attached to window manager
  • How do popBackStack() and replace() operations differ?
  • A boolean value defined in XML. How to reference in Java?
  • Android: launch a custom Preference from a PreferenceActivity
  • What is the extension of a Android Studio project file?
  • One Solution collect form web for “Notification deleteIntent does not work”

    If you want to use the intent with a BroadcastReceiver, you should use PendingIntent.getBroadcast instead of PendingIntent.getService. You might also need to setup an appropriate intent filter.

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.