Search code examples
androidandroid-notification-bar

How to show text in the status bar?


I want to show a number in the status bar, like all the battery apps do (when they show the percentage of the battery in the status bar, usually with a persistent notification).

It seems that I can't set a text to appear on the status bar, only an image.

So is the only way is to create X images (e.g. 100 images for battery apps each with a different name) and to switch between them?

Thanks.


Solution

  • Use setNumber() with your Notification.Builder or NotificationCompat.Builder.