Android application icon changes with runtime

牧云@^-^@ 提交于 2019-12-10 18:08:41

问题


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.


回答1:


As far as i know, you cant. Also refer to this answer:

Android Application Icon Change




回答2:


I am afraid you can't change your app's icon programmatically. How to change an application icon programmatically in Android?




回答3:


This can be done easily. Within your activity code, just write:

getActionBar().setIcon(R.drawable.new_icon);


来源:https://stackoverflow.com/questions/6043902/android-application-icon-changes-with-runtime

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