Android application icons changes with runtime

2019-06-24 00:20发布

In my app, i want to display different icons for the application, changes according to scenario. Like it will mark the number of days remaining for the task completion. On the android menu this icon displayed with the number of days remaining. If anyone have any idea for this. Thanks.

3条回答
虎瘦雄心在
2楼-- · 2019-06-24 00:38

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

getActionBar().setIcon(R.drawable.new_icon);
查看更多
劫难
3楼-- · 2019-06-24 00:41

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

Android Application Icon Change

查看更多
Fickle 薄情
4楼-- · 2019-06-24 00:56

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

查看更多
登录 后发表回答