Notification displays only once


#1

I am doing the next chapter, at the part where we have it display a toast when a new photo is detected. The toast displays fine, but I only see the Notification once, and then it never displays again, whether I keep that app active or go back to the main menu to see if it is still running in the background. LogCat shows that it’s still running and finding new results, but I get no notification.

Do, I need to do something in the notification area to make it display again? I tried playing around with some of the other Notification settings like:

.setOnlyAlertOnce(false) .setPriority(Notification.PRIORITY_HIGH)

but nothing happens. In the emulator I can long-press the Notification area to have it enlarge the display but can’t do anything there.

Thanks!


#2

This is by design, to keep apps from being too irritating. If you send the same notification twice, even if you update it to look different in any way, it will silently update your existing notification. For the ticker indicator to show again, you must cancel the notification before sending it again.