Artiom Chilaru
Artiom Chilaru

Reputation: 12201

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?

Upvotes: 8

Views: 2027

Answers (1)

H9kDroid
H9kDroid

Reputation: 1824

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());

Upvotes: 9

Related Questions