Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create notification without it popping up

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?

like image 725
Artiom Chilaru Avatar asked Nov 13 '11 15:11

Artiom Chilaru


1 Answers

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());
like image 114
H9kDroid Avatar answered Oct 05 '22 13:10

H9kDroid