How to add application icon in notification tray?

Barmaley picture Barmaley · Feb 16, 2011 · Viewed 18.5k times · Source

I understand that it's possible. At least I see that various applications used to put in notification tray their icons (e.g. Skype).

What about my application? What should I do to put my icon or message in notification bar?

Answer

Thomas picture Thomas · Feb 16, 2011

Documentation.

You specify the UI information and actions for a notification in a NotificationCompat.Builder object. To create the notification itself, you call NotificationCompat.Builder.build(), which returns a Notification object containing your specifications. To issue the notification, you pass the Notification object to the system by calling NotificationManager.notify()...