j2emanue
j2emanue

Reputation: 62519

How to add a badge to android notification inside the pull down menu?

I saw that google's gmail has a notification that shows with a small badge and i was wondering if that is something i can add to my notifications. Here is an example:

enter image description here

See the RED little badge hanging off the icon. is that something i can utilize. I am targeting the following in gradle:

 minSdkVersion 19
        targetSdkVersion 24

Upvotes: 0

Views: 168

Answers (1)

Rahul Devanavar
Rahul Devanavar

Reputation: 4165

You can achieve this using

NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
                .setSmallIcon(R.drawable.ic_launcher)
                .setLargeIcon(largeIcon)

Upvotes: 1

Related Questions