Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is FLAG_ONLY_ALERT_ONCE broken, or wrong, or both?

From the android documentation on Notifications:

FLAG_ONLY_ALERT_ONCE

Bit to be bitwise-ored into the flags field that should be set if you want the sound and/or vibration play each time the notification is sent, even if it has not been canceled before that.

Doesn't this description seem like the opposite of what it should be? Also, if I want the notification to alert every time, should I OR this onto the flags field or not? I'm also seeing conflicting claims of if this 'works' .... whatever that means!

like image 626
you786 Avatar asked Jun 06 '12 22:06

you786


1 Answers

After some testing, it seems that FLAG_ONLY_ALERT_ONCE does what it is named, not what the API description says.

To have a notification alert every time it is issued, make sure you do not OR the FLAG_ONLY_ALERT_ONCE bit into the notification.flags.

I've issued a bug report here: https://code.google.com/p/android/issues/detail?id=33003

like image 122
you786 Avatar answered Sep 17 '22 05:09

you786