Search code examples
androidnotificationstray

How to add application icon in notification tray?


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?


Solution

  • 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()...