[android-developers] Re: How to remove a notification with flag FLAG_NO_CLEAR ?

2010-09-24 Thread NRV
OK, I found the problem. In fact there where 2 problems : - I have to restart completely the emulator between each code change. Redeploying the application usually works, but, for some strange reason not with the notifications. - I was keeping a reference on the notification. I now recreate a new

[android-developers] Re: How to remove a notification with flag FLAG_NO_CLEAR ?

2010-09-24 Thread Nikhil
On Wed, Sep 22, 2010 at 2:52 AM, NRV n.he...@laposte.net wrote: notification.setLatestEventInfo(getApplicationContext(), contentTitle, contentText, contentIntent); P.S. - Don't use getApplicationContext - use this or your most local context. why is that? -- You received this message

Re: [android-developers] Re: How to remove a notification with flag FLAG_NO_CLEAR ?

2010-09-24 Thread TreKing
On Wed, Sep 22, 2010 at 9:41 PM, Nikhil nik...@superfacts.org wrote: why is that? The big reason is that there are UI-related functions that take Contexts but really expect Activities and if you use getApplicationContext() instead of your Activity as the Context for, say, creating a dialog,

[android-developers] Re: How to remove a notification with flag FLAG_NO_CLEAR ?

2010-09-24 Thread Ryan Mattison
public class SuperActivity extends Activity { @override public Context getApplicationContext() { throw new STOPIT(); } public class STOPIT extends Exception { ... getMessage() { return WTF DUDE, we discussed this } } } public class SuperActivity extends Activity { onCreate } On Sep 24,

[android-developers] Re: How to remove a notification with flag FLAG_NO_CLEAR ?

2010-09-24 Thread Ryan Mattison
Below works to help yourself through! public class SuperActivity extends Activity { @override public Context getApplicationContext() { throw new STOPIT(); } public class STOPIT extends Exception { ... getMessage() { return WTF DUDE, we discussed this } } } public class FunctionalActivity

[android-developers] Re: How to remove a notification with flag FLAG_NO_CLEAR ?

2010-09-23 Thread DanH
What happens if you clear the flag before trying the cancel? On Sep 22, 2:52 am, NRV n.he...@laposte.net wrote: Hi, I create a notification for a background service : [...] notification = new Notification(icon, tickerText, when); notification.flags = Notification.DEFAULT_ALL |

Re: [android-developers] Re: How to remove a notification with flag FLAG_NO_CLEAR ?

2010-09-23 Thread TreKing
On Thu, Sep 23, 2010 at 1:42 PM, DanH danhi...@ieee.org wrote: What happens if you clear the flag before trying the cancel? I think he tried that: On Thu, Sep 23, 2010 at 3:19 AM, Nicolas HERVE n.he...@laposte.net wrote: Then I tried to change the flags before canceling notification.flags