Create notification without it popping up
Asked Answered
A

1

8

I'm trying to add an android notification to the "tray" in android 3, but I don't want it to "pop up" every time I call notify().

I managed to kind of do this by setting the FLAG_ONLY_ALERT_ONCE flag on the notification, but it will still alert when I set it for the first time.

It seems like this is possible, but I'm not sure how to do this (an example is the Prime ROM for the Asus transformer. When you plug in the dock, a new ongoing notification will be added to the notification area, but there is no alert, or "popup" there.. It just adds another icon to the list quietly. How can I do the same?

Accra answered 13/11, 2011 at 15:52 Comment(0)
R
9

Just set the tickerText to null. You can do this when creating your notification with:

Notification notification = new Notification( R.drawable.icon, null, System.currentTimeMillis());
Recriminate answered 13/11, 2011 at 16:14 Comment(1)
Can't believe it was THAT simple! Thanks :)Accra

© 2022 - 2024 — McMap. All rights reserved.