Make dynamic start icon

I want to create a launch icon similar to the native messaging app on Android. The icon of this application has an image, but also has a dynamically changing number (counter, which corresponds to the number of unread messages). Also, this icon is not widgets, as it is the actual icon that is present in the application box.

Can someone explain to me how I can do this? I found some solution that includes a widget with dimensions set to 1x1, but I do not want people to add shortcuts to my application as a widget. If possible, I would like to manipulate the launch icon in some programmatic way.

Thanks in advance!

Note: A question like mine was asked a long time ago. However, having seen that since then the Android API has gone through many changes, older answers may or may not be applicable - hence the need for a new question. ( link )

+6
source share
2 answers

Can someone explain to me how I can do this?

It is not possible to create your own home screen using your own launcher.

+7
source

You cannot make Dynamic launcher icon .

Alternatively, you can create a Home Screen Widget , similar to your icon, that can refresh itself.

Here's a tutorial on how to make a Home Screen Widget .

If you need to get this on the Menu an Android device, I think it's necessary, as @CommonsWare said.

0
source

Source: https://habr.com/ru/post/907169/


All Articles