Make a dynamic launcher icon

好久不见. 提交于 2019-12-21 14:08:37

问题


I want to create a launcher icon similar to the native Messaging application in Android. The icon of this app has an image but also have a dynamically changing number(a counter of some sort that corresponds to the number of unread messages). Also this icon it is not an widget, as it's an actual icon that's present in the application drawer.

Can someone explain to me how I can go about to achieve this? I found some solution that includes a widget with the dimensions set to 1x1 but I do not want people to add shortcuts to my app as widget. If possible, I'd want to manipulate the launcher icon in some programmatical way.

Thanks in advance!

Note: There is a question similar to mine asked a long time ago. However, seeing that the Android API has gone through a lot of changes since then, the older answers may or may not be applicable - hence the need for a new question. (link)


回答1:


Can someone explain me how can I do this ?

You can't, short of creating your own home screen with your own launcher.




回答2:


You cannot make an Dynamic launcher icon.

Alternatively, you can design a Home Screen Widget similar to your icon which can update itself.

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

If you need to get that on the Menu of an Android Device, I think it is necessary what @CommonsWare said.



来源:https://stackoverflow.com/questions/9055836/make-a-dynamic-launcher-icon

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!