Android应用程序图标随运行时变化
在我的应用程序中,我想显示应用程序的不同图标。应根据场景进行更改。例如,它将标记任务完成的剩余天数。在 Android 菜单上,此图标将显示剩余天数。如果有人对此有任何想法,我将不胜感激。谢谢。
In my app I want to display different icons for the application. Changes should be according to the scenario. For example, it will mark the number of days remaining for the task completion. On the android menu this icon will display the number of days remaining. If anyone has any idea for this, I would appreciate it. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
实际上有很多方法可以实现这一目标。如果你最近注意到谷歌的时钟应用程序,它确实会显示当前时间。
您可以参考本教程:https://blog.jakelee.co。 uk/programmatically-change-app-icon/
或者在这里找到更多方法:如何在 Android 中以编程方式更改应用程序图标?
There are actually a number of ways to achieve this. If you notice Google's clock app these days, it does show the current time.
You can refer to this tutorial: https://blog.jakelee.co.uk/programmatically-changing-app-icon/
Or find even more ways here: How to change an application icon programmatically in Android?
据我所知,你不能。另请参阅此答案:
Android 应用程序图标更改
As far as i know, you cant. Also refer to this answer:
Android Application Icon Change
恐怕您无法以编程方式更改应用程序的图标。 如何在 Android 中以编程方式更改应用程序图标?
I am afraid you can't change your app's icon programmatically. How to change an application icon programmatically in Android?
这很容易做到。在您的活动代码中,只需编写:
This can be done easily. Within your activity code, just write: