1

I am making an app that allows the user to set an alarm based on GPS locations. I am having problems deleting the notifications I create and the alarms I set.

I have found that all the notifications and alarms are deleted permanently when I use the "Advanced Task Killer App". I want to implement whatever it does into my app. Does anyone know what this app does and/or where I can find the source code?

Thanks in advance.

Yasir Malang
  • 835
  • 3
  • 10
  • 15
  • 2
    The primary technique used by so-called "task killers" -- the one that eliminates your notifications and alarms -- is disabled in Android 2.2 and should remain so going forward. I would counsel you to focus instead on determining where you are going wrong with your management of notifications and alarms. – CommonsWare Aug 11 '10 at 19:19
  • 2
    Why make a second question? : http://stackoverflow.com/questions/3461743/how-to-cancel-android-notifications – Jamie Keeling Aug 11 '10 at 19:20
  • sorry about the 2 questions... – Yasir Malang Aug 13 '10 at 00:08

2 Answers2

1

Did you try to post your notification with an integer ID? Like so,

notify(MY_NOTE_ID, notification);

If that's the case, you can simply get the notification manager to cancel them by calling

cancel(MY_NOTE_ID);

Also, make sure to use flags such as Notification.FLAG_ONGOING_EVENT and Notification.FLAG_AUTO_CANCEL appropriately. The ongoing flag makes the notification show up in on-going section, and auto cancel flag ensures the notification disappears when you click on it.

Jack
  • 830
  • 1
  • 7
  • 12
0

"Advanced Task Killer App" simply reads the current applications that are open and will close them at a time of it's choosing or if you hit the "Close All" button.

The fact that notifications and alarms being closed is a side affect, I myself have missed many alarms (as well as Lectures) due to the task killer "killing" applications.

In terms of how does it work via code, look at the other question you have asked.

Jamie Keeling
  • 9,806
  • 17
  • 65
  • 102