Android Notification Dynamic Icon

androiddynamiciconsnotifications

Is it possible to overlay a notification icon with some text/int? or is it possible to generate a custom icon on the fly?

For example I have the current icon displayed for my notification, I would like to be able to display for example the number 2 within the red box.

icon

As this is not a count of notifications ( so not the red bubble ), the setting the "number" in the notification will not work.

Will I have to just create an individual icon for every possible number I wish to display? Or is there a better way of achieving this?

Best Answer

Try using AnimationDrawable's. You can use them to combine multiple drawables into a single one, and select the one you want to display. I really think, this is the way to go.

More info: AnimationDrawable

Off course, you will have to provide individual drawables for all your Integers you want to display, but this way, you can easily change the appearance of your notifications