Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - incremental status bar notification icon

You know what I'm talking about: for example when you get multiple new emails the notification icon in the status bar is augmented with a little red circle that contains number of unread mails. Twitroid has the same icon. Any idea how it's done? I don't think (or so I hope) there are 10000 similar icons. Is this red circle generated and overlaid the notification icon? If so - any code snippets will be much appreciated.

like image 390
Bostone Avatar asked Dec 18 '09 18:12

Bostone


People also ask

How do I change my status bar icon?

To customize it, first pull down the slider bar from the top of the screen. Next, tap on the three vertical dots in the top right corner. Now click on Status bar. You're in.

How do I remove the User icon from my notification bar?

With a stock Android phone, press and hold Settings until System Settings appears. Select System UI Tuner > Status Bar, and turn off all the options.

What is notification icon in android?

Notification icons appear on the left side of the status bar. Users can swipe down on the status bar to open the notification drawer, where they can view more details and take actions with the notification.


1 Answers

This one is nice and easy, just change Notification.number to whatever number you want to appear on your Notification, e.g.:

Notification notification = new Notification(icon, tickerText, when);
notification.number = 4;
like image 117
Dan Lew Avatar answered Sep 29 '22 18:09

Dan Lew