0

I've got a receiver set up in my android application to catch android.intent.action.NOTIFICATION_REMOVE intents. On my Evo, it works fine - when a notification is cleared from the notification bar, I catch that event and can run some code. I tried running this on a Samsung Moment though, and it is never caught. So now I'm trying to figure out why, and I can't seem to find anything on Google about this intent action - and I set this code up a few months ago, so I don't remember where I even found this action, it doesn't seem to be in the API.

The evo is running 2.2, and the moment is running 2.1-update1, so I'm guessing that it's undocumented, and only available in 2.2. Is there any other way to catch an event that a notification has been cleared? Note that I'm not trying to cancel a notification that I put up, or trying to cancel another app's notification, just catch an event when a notification has been cleared.

Here's my receiver in AndroidManafest.xml:

<receiver android:name=".NotificationClearedReciever"> 
    <intent-filter> 
        <action android:name="android.intent.action.NOTIFICATION_REMOVE" /> 
    </intent-filter> 
</receiver> 
Matt McMinn
  • 15,983
  • 17
  • 62
  • 77

1 Answers1

1

I asked on the Android mailing list, and the answer was that android.intent.action.NOTIFICATION_REMOVE is non standard, and therefore can't be relied upon.

Matt McMinn
  • 15,983
  • 17
  • 62
  • 77
  • Did you ever find a work-around or a different flag that achieves the same functionality? – Brian Sep 19 '11 at 03:03
  • Nope - it looks like this is available on Sense devices, but I haven't found anything for stock android. – Matt McMinn Sep 19 '11 at 13:44
  • Oh I posted a question about how to detect when the "Clear All Notification" buttons was pressed yesterday. I was able to find a solution that works involving BroadcastReceivers. Here's my post, perhaps you will find this useful: http://stackoverflow.com/questions/7465849/how-to-use-notification-deleteintent/7465887#7465887 – Brian Sep 19 '11 at 20:54